Skip to content

Commit b46632b

Browse files
committed
bsp for f2 f3
1 parent 322f58e commit b46632b

File tree

11 files changed

+40
-69
lines changed

11 files changed

+40
-69
lines changed

.github/workflows/build_arm.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ jobs:
4141
- 'nrf'
4242
- 'ra'
4343
- 'rp2040'
44-
- 'samd11 same5x'
45-
- 'samd21'
46-
- 'samd51'
44+
- 'samd11 samd21'
45+
- 'samd51 same5x'
4746
- 'saml2x'
48-
- 'stm32f0 stm32f1'
47+
- 'stm32f0 stm32f1 stm32f2 stm32f3'
4948
- 'stm32f4'
5049
- 'stm32f7'
5150
- 'stm32g4 stm32h7'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CFLAGS += \
2+
-DSTM32F207xx \
3+
4+
# All source paths should be relative to the top level.
5+
LD_FILE = $(BOARD_PATH)/STM32F207ZGTx_FLASH.ld
6+
7+
SRC_S += \
8+
$(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
9+
10+
# For flash-jlink target
11+
JLINK_DEVICE = stm32f207zg
12+
13+
# flash target using on-board stlink
14+
flash: flash-stlink

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This file is part of the TinyUSB stack.
2525
*/
2626

27-
#include "../board.h"
27+
#include "bsp/board.h"
2828

2929
#include "stm32f2xx_hal.h"
3030

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
ST_FAMILY = f2
2-
DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
32

43
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
54
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
65

6+
DEPS_SUBMODULES += \
7+
lib/CMSIS_5 \
8+
$(ST_CMSIS) \
9+
$(ST_HAL_DRIVER)
10+
11+
include $(TOP)/$(BOARD_PATH)/board.mk
12+
713
CFLAGS += \
814
-flto \
915
-mthumb \
1016
-mabi=aapcs \
1117
-mcpu=cortex-m3 \
1218
-mfloat-abi=soft \
1319
-nostdlib -nostartfiles \
14-
-DSTM32F207xx \
1520
-DCFG_TUSB_MCU=OPT_MCU_STM32F2
1621

1722
# mcu driver cause following warnings
1823
CFLAGS += -Wno-error=sign-compare
1924

20-
# All source paths should be relative to the top level.
21-
LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld
22-
2325
SRC_C += \
2426
src/portable/synopsys/dwc2/dcd_dwc2.c \
2527
$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
@@ -29,20 +31,11 @@ SRC_C += \
2931
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
3032
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
3133

32-
SRC_S += \
33-
$(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
34-
3534
INC += \
3635
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
3736
$(TOP)/$(ST_CMSIS)/Include \
3837
$(TOP)/$(ST_HAL_DRIVER)/Inc \
39-
$(TOP)/hw/bsp/$(BOARD)
38+
$(TOP)/$(BOARD_PATH)
4039

4140
# For freeRTOS port source
4241
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM3
43-
44-
# For flash-jlink target
45-
JLINK_DEVICE = stm32f207zg
46-
47-
# flash target using on-board stlink
48-
flash: flash-stlink
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CFLAGS += \
2+
-DSTM32F303xC \
3+
4+
# All source paths should be relative to the top level.
5+
LD_FILE = $(BOARD_PATH)/STM32F303VCTx_FLASH.ld
6+
7+
SRC_S += \
8+
$(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
9+
10+
# For flash-jlink target
11+
JLINK_DEVICE = stm32f303vc
12+
13+
# flash target using on-board stlink
14+
flash: flash-stlink

0 commit comments

Comments
 (0)