Skip to content

Commit f671816

Browse files
[bsp/ft32] 新增 ft32f407xe-starter 板级支持 (#11130)
新增 ft32f407xe-starter 板级支持
1 parent 3a2d67e commit f671816

File tree

113 files changed

+5799
-55664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+5799
-55664
lines changed

.github/ALL_BSP_COMPILE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"asm9260t",
7474
"allwinner_tina",
7575
"ft32/ft32f072xb-starter",
76+
"ft32/ft32f407xe-starter",
7677
"mini2440",
7778
"at91/at91sam9g45",
7879
"at91/at91sam9260",

bsp/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ This document is based on the RT-Thread mainline repository and categorizes the
543543
| BSP Name | GPIO | UART |
544544
|----------|------|------|
545545
| [ft32f072xb-starter](ft32/ft32f072xb-starter) |||
546+
| [ft32f407xe-starter](ft32/ft32f407xe-starter) |||
546547

547548
#### ⚪ Fujitsu
548549

bsp/ft32/.clang-format-ignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

bsp/ft32/ft32f072xb-starter/.config

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,23 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
731731
# HAL & SDK Drivers
732732
#
733733

734+
#
735+
# FT32 Drivers
736+
#
737+
CONFIG_PKG_USING_FT32F0_STD_DRIVER=y
738+
CONFIG_PKG_FT32F0_STD_DRIVER_PATH="/packages/peripherals/hal-sdk/ft32/ft32f0_std_driver"
739+
CONFIG_PKG_USING_FT32F0_STD_DRIVER_LATEST_VERSION=y
740+
CONFIG_PKG_FT32F0_STD_DRIVER_VER="latest"
741+
CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER=y
742+
CONFIG_PKG_FT32F0_CMSIS_DRIVER_PATH="/packages/peripherals/hal-sdk/ft32/ft32f0_cmsis_driver"
743+
CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER_LATEST_VERSION=y
744+
CONFIG_PKG_FT32F0_CMSIS_DRIVER_VER="latest"
745+
# CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER is not set
746+
# CONFIG_PKG_USING_FT32F0_STD_DRIVER is not set
747+
# CONFIG_PKG_USING_FT32F4_CMSIS_DRIVER is not set
748+
# CONFIG_PKG_USING_FT32F4_STD_DRIVER is not set
749+
# end of FT32 Drivers
750+
734751
#
735752
# STM32 HAL & SDK Drivers
736753
#

bsp/ft32/ft32f072xb-starter/SConstruct

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,27 @@ except:
1414
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
1515
print(RTT_ROOT)
1616
exit(-1)
17+
18+
def bsp_pkg_check():
19+
import subprocess
1720

18-
TARGET = 'rt-thread_ft32f072.' + rtconfig.TARGET_EXT
21+
check_paths = [
22+
os.path.join("packages", "ft32f0_cmsis_driver-latest"),
23+
os.path.join("packages", "ft32f0_std_driver-latest")
24+
]
25+
26+
need_update = not all(os.path.exists(p) for p in check_paths)
27+
28+
if need_update:
29+
print("\n===============================================================================")
30+
print("Dependency packages missing, please running 'pkgs --update'...")
31+
print("If no packages are fetched, run 'pkgs --upgrade' first, then 'pkgs --update'...")
32+
print("===============================================================================")
33+
exit(1)
34+
35+
RegisterPreBuildingAction(bsp_pkg_check)
36+
37+
TARGET = 'rt-thread.' + rtconfig.TARGET_EXT
1938

2039
DefaultEnvironment(tools=[])
2140
env = Environment(tools = ['mingw'],
@@ -31,6 +50,7 @@ if rtconfig.PLATFORM in ['iccarm']:
3150
env.Replace(ARFLAGS = [''])
3251
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
3352

53+
Export('env')
3454
Export('RTT_ROOT')
3555
Export('rtconfig')
3656

@@ -41,20 +61,13 @@ if os.path.exists(SDK_ROOT + '/libraries'):
4161
else:
4262
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
4363

44-
SDK_LIB = libraries_path_prefix
45-
Export('SDK_LIB')
46-
4764
# prepare building environment
4865
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
4966

50-
ft32_library = 'FT32F0xx'
51-
rtconfig.BSP_LIBRARY_TYPE = ft32_library
52-
53-
# include libraries
54-
objs.extend(SConscript(os.path.join(libraries_path_prefix, ft32_library, 'SConscript')))
67+
rtconfig.BSP_LIBRARY_TYPE = None
5568

5669
# include drivers
57-
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'Drivers', 'SConscript')))
70+
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'STD_Drivers', 'SConscript'), variant_dir='../libraries/Drivers', duplicate=0))
5871

5972
# make a building
6073
DoBuilding(TARGET, objs)

bsp/ft32/ft32f072xb-starter/board/Kconfig

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
menu "Hardware Drivers Config"
22

3+
config SOC_SERIES_FT32F0
4+
bool
5+
default y
6+
37
config SOC_FT32F072RB
48
bool
59
select SOC_SERIES_FT32F0
@@ -21,27 +25,30 @@ menu "On-chip Peripheral Drivers"
2125
menuconfig BSP_USING_UART
2226
bool "Enable UART"
2327
default y
24-
select RT_USING_SERIAL
2528
if BSP_USING_UART
26-
config BSP_USING_UART1
29+
choice
30+
prompt "Select UART framework version"
31+
default BSP_USING_SERIAL_V1
32+
33+
config BSP_USING_SERIAL_V1
34+
bool "Use Serial V1 framework"
35+
select RT_USING_SERIAL
36+
37+
config BSP_USING_SERIAL_V2
38+
bool "Use Serial V2 framework"
39+
select RT_USING_SERIAL_V2
40+
endchoice
41+
42+
menuconfig BSP_USING_UART1
2743
bool "Enable UART1"
2844
default n
2945

30-
config BSP_UART1_RX_USING_DMA
31-
bool "Enable UART1 RX DMA"
32-
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
33-
default n
34-
35-
config BSP_USING_UART2
46+
menuconfig BSP_USING_UART2
3647
bool "Enable UART2"
3748
default y
38-
39-
config BSP_UART2_RX_USING_DMA
40-
bool "Enable UART2 RX DMA"
41-
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
42-
default n
4349
endif
44-
rsource "../../libraries/Drivers/Kconfig"
50+
51+
source "$(BSP_DIR)/../libraries/Drivers/Kconfig"
4552

4653
endmenu
4754

bsp/ft32/ft32f072xb-starter/board/SConscript

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import os
2-
import rtconfig
32
from building import *
43

5-
Import('SDK_LIB')
6-
74
cwd = GetCurrentDir()
85

96
# add general drivers
@@ -13,15 +10,6 @@ board.c
1310

1411
path = [cwd]
1512

16-
startup_path_prefix = SDK_LIB
17-
18-
if rtconfig.PLATFORM in ['gcc']:
19-
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/gcc/startup_ft32f072xb.s']
20-
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
21-
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/arm/startup_ft32f072xb.s']
22-
elif rtconfig.PLATFORM in ['iccarm']:
23-
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/iar/startup_ft32f072xb.s']
24-
2513
# FT32F072x8 || FT32F072xB
2614
# You can select chips from the list above
2715
CPPDEFINES = ['FT32F072xB']

bsp/ft32/ft32f072xb-starter/rtconfig.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@
265265

266266
/* CMSIS: ARM Cortex-M Microcontroller Software Interface Standard */
267267

268+
#define PKG_USING_CMSIS_CORE
269+
#define PKG_USING_CMSIS_CORE_LATEST_VERSION
268270
/* end of CMSIS: ARM Cortex-M Microcontroller Software Interface Standard */
269271

270272
/* Micrium: Micrium software products porting for RT-Thread */
@@ -379,7 +381,10 @@
379381
/* end of Device Control */
380382

381383
/* Other */
382-
384+
#define PKG_USING_FT32F0_STD_DRIVER
385+
#define PKG_USING_FT32F0_STD_DRIVER_LATEST_VERSION
386+
#define PKG_USING_FT32F0_CMSIS_DRIVER
387+
#define PKG_USING_FT32F0_CMSIS_DRIVER_LATEST_VERSION
383388
/* end of Other */
384389

385390
/* Signal IO */

0 commit comments

Comments
 (0)