Skip to content

Commit 2681d13

Browse files
committed
Merge branch 'master' into fix-rr-scheduler
2 parents aa03033 + 886aa24 commit 2681d13

File tree

17 files changed

+29
-25
lines changed

17 files changed

+29
-25
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
NAME = piko
22

3-
# select QEMU when the target is unspecified
4-
TARGET ?= stm32f429
3+
# select QEMU when the platform is unspecified
4+
PLAT ?= f429disco
55
CMSIS = external/cmsis
66

77
# The platform Makefile contains hw details and flags
8-
include target/$(TARGET)/Makefile
8+
include platform/$(PLAT)/Makefile
99

1010
# arch-specific
1111
SSRC += arch/v7m-head.S arch/v7m-entry.S arch/v7m-svcall.S
@@ -39,14 +39,14 @@ deps := $(OBJS:%.o=.%.o.d)
3939

4040
.PHONY: all check clean distclean
4141

42-
all: $(CMSIS)/$(TARGET) $(NAME).lds $(NAME).bin SCHED_FLAGS
42+
all: $(CMSIS)/$(PLAT) $(NAME).lds $(NAME).bin SCHED_FLAGS
4343

4444
# generic build rules
4545
include mk/flags.mk
4646
include mk/rules.mk
4747
include mk/cmsis.mk
4848

49-
prebuild: $(CMSIS)/$(TARGET)
49+
prebuild: $(CMSIS)/$(PLAT)
5050

5151
check:
5252
python3 tests/runner.py
@@ -70,6 +70,6 @@ distclean: clean
7070
rm -rf $(CMSIS)
7171

7272
# platform build contains flashing and running rules
73-
include target/$(TARGET)/build.mk
73+
include platform/$(PLAT)/build.mk
7474

7575
-include $(deps)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is `Piko/RT`, a tiny Linux-like real-time operating system kernel, optimize
77

88
```
99
# Run all test
10-
$ make TARGET=stm32p103 check
10+
$ make PLAT=stm32p103 check
1111
1212
# Run all test with command line tools
1313
$ python -m tests

libc/v7m-pthread.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ ENTRY(pthread_mutex_unlock)
5858
mov r1, #SYS_PTHREAD_MUTEX_UNLOCK
5959
svc #1
6060
2: bx lr
61-
ENDPROC(pthread_mutex_lock)
61+
ENDPROC(pthread_mutex_unlock)

mk/cmsis.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
SVN_REV = 27441
22

3+
ARM_CMSIS_ASSETS = \
4+
mbed_preprocessor.h \
5+
mbed_assert.h
6+
7+
ARM_CMSIS_ASSETS := $(addprefix $(CMSIS)/util/, $(ARM_CMSIS_ASSETS))
8+
39
$(CMSIS):
410
@mkdir -p $@
511

6-
$(CMSIS)/$(TARGET): $(CMSIS)/arm $(CMSIS)/TARGET_STM $(CMSIS)/util
12+
$(CMSIS)/$(PLAT): $(CMSIS)/arm $(CMSIS)/TARGET_STM $(ARM_CMSIS_ASSETS)
713

814
$(CMSIS)/arm:
915
svn export -r$(SVN_REV) --force https://github.com/ARMmbed/mbed-os/trunk/cmsis/ $(CMSIS)/arm
1016

1117
$(CMSIS)/TARGET_STM:
1218
svn export -r$(SVN_REV) --force https://github.com/ARMmbed/mbed-os/trunk/targets/TARGET_STM/ $(CMSIS)/TARGET_STM
1319

14-
$(CMSIS)/util:
15-
@mkdir -p $(CMSIS)/util
16-
# Reference: https://stackoverflow.com/questions/1125476/retrieve-a-single-file-from-a-repository
17-
# https://stackoverflow.com/questions/1078524/how-to-specify-the-location-with-wget
18-
wget https://raw.github.com/ARMmbed/mbed-os/master/platform/mbed_preprocessor.h -P $(CMSIS)/util
19-
wget https://raw.github.com/ARMmbed/mbed-os/master/platform/mbed_assert.h -P $(CMSIS)/util
20+
$(ARM_CMSIS_ASSETS):
21+
$(VECHO) " WGET\t\t$@\n"
22+
$(Q)$(WGET) -q https://raw.github.com/ARMmbed/mbed-os/master/platform/$(notdir $@) -P $(CMSIS)/util

mk/flags.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ AR = $(CROSS_COMPILE)ar
55
OBJCOPY = $(CROSS_COMPILE)objcopy
66
GDB = $(CROSS_COMPILE)gdb
77
HOSTCC = gcc
8+
WGET = wget
89

910
# FIXME: configurable via menuconfig or command line
1011
CFLAGS_OPT = -Os # -flto
@@ -13,7 +14,7 @@ CFLAGS += \
1314
-std=c99 \
1415
-W -Wall \
1516
-Iinclude -Iinclude/libc -I. \
16-
-I$(CMSIS)/arm -I$(CMSIS)/$(TARGET) -I$(CMSIS)/$(TARGET)/hal \
17+
-I$(CMSIS)/arm -I$(CMSIS)/$(PLAT) -I$(CMSIS)/$(PLAT)/hal \
1718
-Iinclude/kernel \
1819
-D_POSIX_THREADS=1 -D_POSIX_TIMERS=1 -D_POSIX_REALTIME_SIGNALS=1 \
1920
-Wno-main -fdiagnostics-color \
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ROMSZ = 2048k
55
RAMSZ = 192k
66

77
CFLAGS += \
8-
-Itarget/stm32f429 \
8+
-Iplatform/f429disco \
99
-I$(CMSIS)/util \
1010
-I$(CMSIS)/arm \
1111
-I$(CMSIS)/arm/TARGET_CORTEX_M \
@@ -18,8 +18,8 @@ CFLAGS += \
1818
-I$(CMSIS)/TARGET_STM//TARGET_STM32F4/TARGET_STM32F429xI/TARGET_DISCO_F429ZI
1919

2020
CSRC += \
21-
target/stm32f429/halt.c \
22-
target/stm32f429/init.c
21+
platform/f429disco/halt.c \
22+
platform/f429disco/init.c
2323

2424
# CMSIS files
2525
## STM32 HAL

0 commit comments

Comments
 (0)