Skip to content

Commit dbf7534

Browse files
committed
update all stm32 to use new enhance make
1 parent edbf06a commit dbf7534

File tree

18 files changed

+75
-134
lines changed

18 files changed

+75
-134
lines changed

hw/bsp/stm32f0/family.mk

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
66
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
77

88
include $(TOP)/$(BOARD_PATH)/board.mk
9+
CPU_CORE ?= cortex-m0
910

1011
# --------------
1112
# Compiler Flags
@@ -17,19 +18,11 @@ CFLAGS += \
1718
# GCC Flags
1819
GCC_CFLAGS += \
1920
-flto \
20-
-mthumb \
21-
-mabi=aapcs \
22-
-mcpu=cortex-m0 \
23-
-mfloat-abi=soft \
2421
-nostdlib -nostartfiles \
2522

2623
# suppress warning caused by vendor mcu driver
2724
GCC_CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
2825

29-
# IAR Flags
30-
IAR_CFLAGS += --cpu cortex-m0
31-
IAR_ASFLAGS += --cpu cortex-m0
32-
3326
# ------------------------
3427
# All source paths should be relative to the top level.
3528
# ------------------------
@@ -51,6 +44,3 @@ INC += \
5144
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
5245
$(TOP)/$(ST_CMSIS)/Include \
5346
$(TOP)/$(ST_HAL_DRIVER)/Inc
54-
55-
# For freeRTOS port source
56-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0

hw/bsp/stm32f1/family.mk

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
55
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
66

77
include $(TOP)/$(BOARD_PATH)/board.mk
8+
CPU_CORE ?= cortex-m3
89

910
# --------------
1011
# Compiler Flags
@@ -15,16 +16,8 @@ CFLAGS += \
1516
# GCC Flags
1617
GCC_CFLAGS += \
1718
-flto \
18-
-mthumb \
19-
-mabi=aapcs \
20-
-mcpu=cortex-m3 \
21-
-mfloat-abi=soft \
2219
-nostdlib -nostartfiles \
2320

24-
# IAR Flags
25-
IAR_CFLAGS += --cpu cortex-m3
26-
IAR_ASFLAGS += --cpu cortex-m3
27-
2821
# ------------------------
2922
# All source paths should be relative to the top level.
3023
# ------------------------
@@ -43,12 +36,6 @@ INC += \
4336
$(TOP)/$(ST_CMSIS)/Include \
4437
$(TOP)/$(ST_HAL_DRIVER)/Inc
4538

46-
# For freeRTOS port source
47-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM3
48-
49-
# For flash-jlink target
50-
JLINK_DEVICE = stm32f103c8
51-
5239
# flash target ROM bootloader
5340
flash-dfu-util: $(BUILD)/$(PROJECT).bin
5441
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<

hw/bsp/stm32f2/boards/stm32f207nucleo/stm32f207nucleo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ uint32_t board_millis(void)
203203

204204
void HardFault_Handler (void)
205205
{
206-
asm("bkpt");
206+
__asm("BKPT #0\n");
207207
}
208208

209209
// Required by __libc_init_array in startup code if we are compiling using

hw/bsp/stm32f2/family.mk

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ DEPS_SUBMODULES += \
99
$(ST_HAL_DRIVER)
1010

1111
include $(TOP)/$(BOARD_PATH)/board.mk
12+
CPU_CORE ?= cortex-m3
1213

1314
CFLAGS += \
15+
-DCFG_TUSB_MCU=OPT_MCU_STM32F2
16+
17+
GCC_CFLAGS += \
1418
-flto \
15-
-mthumb \
16-
-mabi=aapcs \
17-
-mcpu=cortex-m3 \
18-
-mfloat-abi=soft \
1919
-nostdlib -nostartfiles \
20-
-DCFG_TUSB_MCU=OPT_MCU_STM32F2
2120

2221
# mcu driver cause following warnings
23-
CFLAGS += -Wno-error=sign-compare
22+
GCC_CFLAGS += -Wno-error=sign-compare
2423

2524
SRC_C += \
2625
src/portable/synopsys/dwc2/dcd_dwc2.c \
@@ -36,6 +35,3 @@ INC += \
3635
$(TOP)/$(ST_CMSIS)/Include \
3736
$(TOP)/$(ST_HAL_DRIVER)/Inc \
3837
$(TOP)/$(BOARD_PATH)
39-
40-
# For freeRTOS port source
41-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM3

hw/bsp/stm32f3/family.mk

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ DEPS_SUBMODULES += \
99
$(ST_HAL_DRIVER)
1010

1111
include $(TOP)/$(BOARD_PATH)/board.mk
12+
CPU_CORE ?= cortex-m4
1213

1314
CFLAGS += \
1415
-flto \
15-
-mthumb \
16-
-mabi=aapcs \
17-
-mcpu=cortex-m4 \
18-
-mfloat-abi=hard \
19-
-mfpu=fpv4-sp-d16 \
2016
-nostdlib -nostartfiles \
2117
-DCFG_TUSB_MCU=OPT_MCU_STM32F3
2218

@@ -37,6 +33,3 @@ INC += \
3733
$(TOP)/$(ST_CMSIS)/Include \
3834
$(TOP)/$(ST_HAL_DRIVER)/Inc \
3935
$(TOP)/$(BOARD_PATH)
40-
41-
# For freeRTOS port source
42-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F

hw/bsp/stm32f4/family.mk

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
66
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
77

88
include $(TOP)/$(BOARD_PATH)/board.mk
9+
CPU_CORE ?= cortex-m4
910

1011
# --------------
1112
# Compiler Flags
@@ -16,20 +17,11 @@ CFLAGS += \
1617
# GCC Flags
1718
GCC_CFLAGS += \
1819
-flto \
19-
-mthumb \
20-
-mabi=aapcs \
21-
-mcpu=cortex-m4 \
22-
-mfloat-abi=hard \
23-
-mfpu=fpv4-sp-d16 \
2420
-nostdlib -nostartfiles
2521

2622
# suppress warning caused by vendor mcu driver
2723
GCC_CFLAGS += -Wno-error=cast-align
2824

29-
# IAR Flags
30-
IAR_CFLAGS += --cpu cortex-m4 --fpu VFPv4
31-
IAR_ASFLAGS += --cpu cortex-m4 --fpu VFPv4
32-
3325
# -----------------
3426
# Sources & Include
3527
# -----------------
@@ -51,8 +43,5 @@ INC += \
5143
$(TOP)/$(ST_CMSIS)/Include \
5244
$(TOP)/$(ST_HAL_DRIVER)/Inc
5345

54-
# For freeRTOS port source
55-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F
56-
5746
# flash target using on-board stlink
5847
flash: flash-stlink

hw/bsp/stm32f7/family.mk

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
66
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
77

88
include $(TOP)/$(BOARD_PATH)/board.mk
9+
CPU_CORE ?= cortex-m7
910

1011
# --------------
1112
# Compiler Flags
@@ -29,20 +30,11 @@ endif
2930
# GCC Flags
3031
GCC_CFLAGS += \
3132
-flto \
32-
-mthumb \
33-
-mabi=aapcs \
34-
-mcpu=cortex-m7 \
35-
-mfloat-abi=hard \
36-
-mfpu=fpv5-d16 \
3733
-nostdlib -nostartfiles
3834

3935
# mcu driver cause following warnings
4036
GCC_CFLAGS += -Wno-error=shadow -Wno-error=cast-align
4137

42-
# IAR Flags
43-
IAR_CFLAGS += --cpu cortex-m7 --fpu VFPv5_D16
44-
IAR_ASFLAGS += --cpu cortex-m7 --fpu VFPv5_D16
45-
4638
# -----------------
4739
# Sources & Include
4840
# -----------------
@@ -64,6 +56,3 @@ INC += \
6456
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
6557
$(TOP)/$(ST_CMSIS)/Include \
6658
$(TOP)/$(ST_HAL_DRIVER)/Inc
67-
68-
# For freeRTOS port source
69-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM7/r0p1

hw/bsp/stm32g0/family.mk

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
55
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
66

77
include $(TOP)/$(BOARD_PATH)/board.mk
8+
CPU_CORE ?= cortex-m0plus
89

910
# --------------
1011
# Compiler Flags
@@ -15,19 +16,11 @@ CFLAGS += \
1516
# GCC Flags
1617
GCC_CFLAGS += \
1718
-flto \
18-
-mthumb \
19-
-mabi=aapcs \
20-
-mcpu=cortex-m0plus \
21-
-mfloat-abi=soft \
2219
-nostdlib -nostartfiles
2320

2421
# suppress warning caused by vendor mcu driver
2522
GCC_CFLAGS += -Wno-error=cast-align
2623

27-
# IAR Flags
28-
IAR_CFLAGS += --cpu cortex-m0
29-
IAR_ASFLAGS += --cpu cortex-m0
30-
3124
# -----------------
3225
# Sources & Include
3326
# -----------------
@@ -50,8 +43,5 @@ INC += \
5043
$(TOP)/$(ST_CMSIS)/Include \
5144
$(TOP)/$(ST_HAL_DRIVER)/Inc
5245

53-
# For freeRTOS port source
54-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0
55-
5646
# flash target using on-board stlink
5747
flash: flash-stlink

hw/bsp/stm32g4/family.mk

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
66
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
77

88
include $(TOP)/$(BOARD_PATH)/board.mk
9+
CPU_CORE ?= cortex-m4
910

1011
# --------------
1112
# Compiler Flags
@@ -16,20 +17,11 @@ CFLAGS += \
1617
# GCC Flags
1718
GCC_CFLAGS += \
1819
-flto \
19-
-mthumb \
20-
-mabi=aapcs \
21-
-mcpu=cortex-m4 \
22-
-mfloat-abi=hard \
23-
-mfpu=fpv4-sp-d16 \
2420
-nostdlib -nostartfiles \
2521

2622
# suppress warning caused by vendor mcu driver
2723
GCC_CFLAGS += -Wno-error=cast-align
2824

29-
# IAR Flags
30-
IAR_CFLAGS += --cpu cortex-m4 --fpu VFPv4
31-
IAR_ASFLAGS += --cpu cortex-m4 --fpu VFPv4
32-
3325
# -----------------
3426
# Sources & Include
3527
# -----------------
@@ -53,8 +45,5 @@ INC += \
5345
$(TOP)/$(ST_CMSIS)/Include \
5446
$(TOP)/$(ST_HAL_DRIVER)/Inc
5547

56-
# For freeRTOS port source
57-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F
58-
5948
# flash target using on-board stlink
6049
flash: flash-stlink

hw/bsp/stm32l0/family.mk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
88
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
99

1010
include $(TOP)/$(BOARD_PATH)/board.mk
11+
CPU_CORE ?= cortex-m0plus
1112

1213
CFLAGS += \
1314
-flto \
14-
-mthumb \
15-
-mabi=aapcs \
16-
-mcpu=cortex-m0plus \
17-
-mfloat-abi=soft \
1815
-nostdlib -nostartfiles \
1916
-DCFG_EXAMPLE_MSC_READONLY \
2017
-DCFG_EXAMPLE_VIDEO_READONLY \
@@ -42,6 +39,3 @@ INC += \
4239
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
4340
$(TOP)/$(ST_CMSIS)/Include \
4441
$(TOP)/$(ST_HAL_DRIVER)/Inc
45-
46-
# For freeRTOS port source
47-
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0

0 commit comments

Comments
 (0)