summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-19 13:11:41 +0700
committerhathach <[email protected]>2023-03-19 13:11:41 +0700
commitb46632ba07d5e3827029413f69618f41f987f452 (patch)
tree410be2974186e58d56611b6017dc72b5bc13ca66
parent322f58ea8530e2b43d00a087b6d501776be25a00 (diff)
bsp for f2 f3
-rw-r--r--.github/workflows/build_arm.yml7
-rw-r--r--hw/bsp/stm32f2/boards/stm32f207nucleo/STM32F207ZGTx_FLASH.ld (renamed from hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld)0
-rw-r--r--hw/bsp/stm32f2/boards/stm32f207nucleo/board.mk14
-rw-r--r--hw/bsp/stm32f2/boards/stm32f207nucleo/stm32f207nucleo.c (renamed from hw/bsp/stm32f207nucleo/stm32f207nucleo.c)2
-rw-r--r--hw/bsp/stm32f2/family.mk (renamed from hw/bsp/stm32f207nucleo/board.mk)23
-rw-r--r--hw/bsp/stm32f2/stm32f2xx_hal_conf.h (renamed from hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h)0
-rw-r--r--hw/bsp/stm32f3/boards/stm32f303disco/STM32F303VCTx_FLASH.ld (renamed from hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld)0
-rw-r--r--hw/bsp/stm32f3/boards/stm32f303disco/board.mk14
-rw-r--r--hw/bsp/stm32f3/boards/stm32f303disco/stm32f303disco.c (renamed from hw/bsp/stm32f303disco/stm32f303disco.c)0
-rw-r--r--hw/bsp/stm32f3/boards/stm32f303disco/stm32f3xx_hal_conf.h (renamed from hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h)0
-rw-r--r--hw/bsp/stm32f303disco/board.mk49
11 files changed, 40 insertions, 69 deletions
diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
index 8a3181440..2f72e758a 100644
--- a/.github/workflows/build_arm.yml
+++ b/.github/workflows/build_arm.yml
@@ -41,11 +41,10 @@ jobs:
- 'nrf'
- 'ra'
- 'rp2040'
- - 'samd11 same5x'
- - 'samd21'
- - 'samd51'
+ - 'samd11 samd21'
+ - 'samd51 same5x'
- 'saml2x'
- - 'stm32f0 stm32f1'
+ - 'stm32f0 stm32f1 stm32f2 stm32f3'
- 'stm32f4'
- 'stm32f7'
- 'stm32g4 stm32h7'
diff --git a/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld b/hw/bsp/stm32f2/boards/stm32f207nucleo/STM32F207ZGTx_FLASH.ld
index 3fce1b578..3fce1b578 100644
--- a/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld
+++ b/hw/bsp/stm32f2/boards/stm32f207nucleo/STM32F207ZGTx_FLASH.ld
diff --git a/hw/bsp/stm32f2/boards/stm32f207nucleo/board.mk b/hw/bsp/stm32f2/boards/stm32f207nucleo/board.mk
new file mode 100644
index 000000000..ba185d199
--- /dev/null
+++ b/hw/bsp/stm32f2/boards/stm32f207nucleo/board.mk
@@ -0,0 +1,14 @@
+CFLAGS += \
+ -DSTM32F207xx \
+
+# All source paths should be relative to the top level.
+LD_FILE = $(BOARD_PATH)/STM32F207ZGTx_FLASH.ld
+
+SRC_S += \
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
+
+# For flash-jlink target
+JLINK_DEVICE = stm32f207zg
+
+# flash target using on-board stlink
+flash: flash-stlink
diff --git a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c b/hw/bsp/stm32f2/boards/stm32f207nucleo/stm32f207nucleo.c
index 80f762c93..48203b787 100644
--- a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
+++ b/hw/bsp/stm32f2/boards/stm32f207nucleo/stm32f207nucleo.c
@@ -24,7 +24,7 @@
* This file is part of the TinyUSB stack.
*/
-#include "../board.h"
+#include "bsp/board.h"
#include "stm32f2xx_hal.h"
diff --git a/hw/bsp/stm32f207nucleo/board.mk b/hw/bsp/stm32f2/family.mk
index 55581e1ec..7ca378548 100644
--- a/hw/bsp/stm32f207nucleo/board.mk
+++ b/hw/bsp/stm32f2/family.mk
@@ -1,9 +1,15 @@
ST_FAMILY = f2
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += \
+ lib/CMSIS_5 \
+ $(ST_CMSIS) \
+ $(ST_HAL_DRIVER)
+
+include $(TOP)/$(BOARD_PATH)/board.mk
+
CFLAGS += \
-flto \
-mthumb \
@@ -11,15 +17,11 @@ CFLAGS += \
-mcpu=cortex-m3 \
-mfloat-abi=soft \
-nostdlib -nostartfiles \
- -DSTM32F207xx \
-DCFG_TUSB_MCU=OPT_MCU_STM32F2
# mcu driver cause following warnings
CFLAGS += -Wno-error=sign-compare
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld
-
SRC_C += \
src/portable/synopsys/dwc2/dcd_dwc2.c \
$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
@@ -29,20 +31,11 @@ SRC_C += \
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
-
INC += \
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
$(TOP)/$(ST_CMSIS)/Include \
$(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
+ $(TOP)/$(BOARD_PATH)
# For freeRTOS port source
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f207zg
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h b/hw/bsp/stm32f2/stm32f2xx_hal_conf.h
index b38a9d951..b38a9d951 100644
--- a/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h
+++ b/hw/bsp/stm32f2/stm32f2xx_hal_conf.h
diff --git a/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld b/hw/bsp/stm32f3/boards/stm32f303disco/STM32F303VCTx_FLASH.ld
index 981107af1..981107af1 100644
--- a/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld
+++ b/hw/bsp/stm32f3/boards/stm32f303disco/STM32F303VCTx_FLASH.ld
diff --git a/hw/bsp/stm32f3/boards/stm32f303disco/board.mk b/hw/bsp/stm32f3/boards/stm32f303disco/board.mk
new file mode 100644
index 000000000..e387f2d54
--- /dev/null
+++ b/hw/bsp/stm32f3/boards/stm32f303disco/board.mk
@@ -0,0 +1,14 @@
+CFLAGS += \
+ -DSTM32F303xC \
+
+# All source paths should be relative to the top level.
+LD_FILE = $(BOARD_PATH)/STM32F303VCTx_FLASH.ld
+
+SRC_S += \
+ $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
+
+# For flash-jlink target
+JLINK_DEVICE = stm32f303vc
+
+# flash target using on-board stlink
+flash: flash-stlink
diff --git a/hw/bsp/stm32f303disco/stm32f303disco.c b/hw/bsp/stm32f3/boards/stm32f303disco/stm32f303disco.c
index ac9bda983..ac9bda983 100644
--- a/hw/bsp/stm32f303disco/stm32f303disco.c
+++ b/hw/bsp/stm32f3/boards/stm32f303disco/stm32f303disco.c
diff --git a/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h b/hw/bsp/stm32f3/boards/stm32f303disco/stm32f3xx_hal_conf.h
index 82d3765af..82d3765af 100644
--- a/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h
+++ b/hw/bsp/stm32f3/boards/stm32f303disco/stm32f3xx_hal_conf.h
diff --git a/hw/bsp/stm32f303disco/board.mk b/hw/bsp/stm32f303disco/board.mk
deleted file mode 100644
index b81de4ee4..000000000
--- a/hw/bsp/stm32f303disco/board.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-ST_FAMILY = f3
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DSTM32F303xC \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F3
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld
-
-SRC_C += \
- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f303vc
-
-# flash target using on-board stlink
-flash: flash-stlink