Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ALL_BSP_COMPILE.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"asm9260t",
"allwinner_tina",
"ft32/ft32f072xb-starter",
"ft32/ft32f407xe-starter",
"mini2440",
"at91/at91sam9g45",
"at91/at91sam9260",
Expand Down
1 change: 1 addition & 0 deletions bsp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ This document is based on the RT-Thread mainline repository and categorizes the
| BSP Name | GPIO | UART |
|----------|------|------|
| [ft32f072xb-starter](ft32/ft32f072xb-starter) | ✅ | ✅ |
| [ft32f407xe-starter](ft32/ft32f407xe-starter) | ✅ | ✅ |

#### ⚪ Fujitsu

Expand Down
2 changes: 0 additions & 2 deletions bsp/ft32/.clang-format-ignore

This file was deleted.

17 changes: 17 additions & 0 deletions bsp/ft32/ft32f072xb-starter/.config
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,23 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
# HAL & SDK Drivers
#

#
# FT32 Drivers
#
CONFIG_PKG_USING_FT32F0_STD_DRIVER=y
CONFIG_PKG_FT32F0_STD_DRIVER_PATH="/packages/peripherals/hal-sdk/ft32/ft32f0_std_driver"
CONFIG_PKG_USING_FT32F0_STD_DRIVER_LATEST_VERSION=y
CONFIG_PKG_FT32F0_STD_DRIVER_VER="latest"
CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER=y
CONFIG_PKG_FT32F0_CMSIS_DRIVER_PATH="/packages/peripherals/hal-sdk/ft32/ft32f0_cmsis_driver"
CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER_LATEST_VERSION=y
CONFIG_PKG_FT32F0_CMSIS_DRIVER_VER="latest"
# CONFIG_PKG_USING_FT32F0_CMSIS_DRIVER is not set
# CONFIG_PKG_USING_FT32F0_STD_DRIVER is not set
# CONFIG_PKG_USING_FT32F4_CMSIS_DRIVER is not set
# CONFIG_PKG_USING_FT32F4_STD_DRIVER is not set
# end of FT32 Drivers

#
# STM32 HAL & SDK Drivers
#
Expand Down
33 changes: 23 additions & 10 deletions bsp/ft32/ft32f072xb-starter/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,27 @@ except:
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
print(RTT_ROOT)
exit(-1)

def bsp_pkg_check():
import subprocess

TARGET = 'rt-thread_ft32f072.' + rtconfig.TARGET_EXT
check_paths = [
os.path.join("packages", "ft32f0_cmsis_driver-latest"),
os.path.join("packages", "ft32f0_std_driver-latest")
]

need_update = not all(os.path.exists(p) for p in check_paths)

if need_update:
print("\n===============================================================================")
print("Dependency packages missing, please running 'pkgs --update'...")
print("If no packages are fetched, run 'pkgs --upgrade' first, then 'pkgs --update'...")
print("===============================================================================")
exit(1)

RegisterPreBuildingAction(bsp_pkg_check)

TARGET = 'rt-thread.' + rtconfig.TARGET_EXT

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

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

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

SDK_LIB = libraries_path_prefix
Export('SDK_LIB')

# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

ft32_library = 'FT32F0xx'
rtconfig.BSP_LIBRARY_TYPE = ft32_library

# include libraries
objs.extend(SConscript(os.path.join(libraries_path_prefix, ft32_library, 'SConscript')))
rtconfig.BSP_LIBRARY_TYPE = None

# include drivers
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'Drivers', 'SConscript')))
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'STD_Drivers', 'SConscript'), variant_dir='../libraries/Drivers', duplicate=0))

# make a building
DoBuilding(TARGET, objs)
35 changes: 21 additions & 14 deletions bsp/ft32/ft32f072xb-starter/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
menu "Hardware Drivers Config"

config SOC_SERIES_FT32F0
bool
default y

config SOC_FT32F072RB
bool
select SOC_SERIES_FT32F0
Expand All @@ -21,27 +25,30 @@ menu "On-chip Peripheral Drivers"
menuconfig BSP_USING_UART
bool "Enable UART"
default y
select RT_USING_SERIAL
if BSP_USING_UART
config BSP_USING_UART1
choice
prompt "Select UART framework version"
default BSP_USING_SERIAL_V1

config BSP_USING_SERIAL_V1
bool "Use Serial V1 framework"
select RT_USING_SERIAL

config BSP_USING_SERIAL_V2
bool "Use Serial V2 framework"
select RT_USING_SERIAL_V2
endchoice

menuconfig BSP_USING_UART1
bool "Enable UART1"
default n

config BSP_UART1_RX_USING_DMA
bool "Enable UART1 RX DMA"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n

config BSP_USING_UART2
menuconfig BSP_USING_UART2
bool "Enable UART2"
default y

config BSP_UART2_RX_USING_DMA
bool "Enable UART2 RX DMA"
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
default n
endif
rsource "../../libraries/Drivers/Kconfig"

source "$(BSP_DIR)/../libraries/Drivers/Kconfig"

endmenu

Expand Down
12 changes: 0 additions & 12 deletions bsp/ft32/ft32f072xb-starter/board/SConscript
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import os
import rtconfig
from building import *

Import('SDK_LIB')

cwd = GetCurrentDir()

# add general drivers
Expand All @@ -13,15 +10,6 @@ board.c

path = [cwd]

startup_path_prefix = SDK_LIB

if rtconfig.PLATFORM in ['gcc']:
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/gcc/startup_ft32f072xb.s']
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/arm/startup_ft32f072xb.s']
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/FT32F0xx/CMSIS/FT32F0xx/source/iar/startup_ft32f072xb.s']

# FT32F072x8 || FT32F072xB
# You can select chips from the list above
CPPDEFINES = ['FT32F072xB']
Expand Down
7 changes: 6 additions & 1 deletion bsp/ft32/ft32f072xb-starter/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@

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

#define PKG_USING_CMSIS_CORE
#define PKG_USING_CMSIS_CORE_LATEST_VERSION
/* end of CMSIS: ARM Cortex-M Microcontroller Software Interface Standard */

/* Micrium: Micrium software products porting for RT-Thread */
Expand Down Expand Up @@ -379,7 +381,10 @@
/* end of Device Control */

/* Other */

#define PKG_USING_FT32F0_STD_DRIVER
#define PKG_USING_FT32F0_STD_DRIVER_LATEST_VERSION
#define PKG_USING_FT32F0_CMSIS_DRIVER
#define PKG_USING_FT32F0_CMSIS_DRIVER_LATEST_VERSION
/* end of Other */

/* Signal IO */
Expand Down
Loading