Skip to content

Commit 29ab533

Browse files
authored
bsp:Separate HC32F4 series library (#10427)
* bsp:Separate HC32F4 series library
1 parent 1fe2a0b commit 29ab533

File tree

685 files changed

+15048
-1108114
lines changed

Some content is hidden

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

685 files changed

+15048
-1108114
lines changed

bsp/hc32/ev_hc32f448_lqfp80/.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
496496
# CONFIG_PKG_USING_QMODBUS is not set
497497
# CONFIG_PKG_USING_PNET is not set
498498
# CONFIG_PKG_USING_OPENER is not set
499+
# CONFIG_PKG_USING_FREEMQTT is not set
499500
# end of IoT - internet of things
500501

501502
#
@@ -725,6 +726,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
725726
# CONFIG_PKG_USING_RMP is not set
726727
# CONFIG_PKG_USING_R_RHEALSTONE is not set
727728
# CONFIG_PKG_USING_HEARTBEAT is not set
729+
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
728730
# end of system packages
729731

730732
#
@@ -848,6 +850,14 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
848850
#
849851
# HC32 DDL Drivers
850852
#
853+
CONFIG_PKG_USING_HC32F4_CMSIS_DRIVER=y
854+
CONFIG_PKG_HC32F4_CMSIS_DRIVER_PATH="/packages/peripherals/hal-sdk/hc32/hc32_f4_cmsis"
855+
CONFIG_PKG_USING_HC32F4_CMSIS_DRIVER_LATEST_VERSION=y
856+
CONFIG_PKG_HC32F4_CMSIS_DRIVER_VER="latest"
857+
CONFIG_PKG_USING_HC32F4_SERIES_DRIVER=y
858+
CONFIG_PKG_HC32F4_SERIES_DRIVER_PATH="/packages/peripherals/hal-sdk/hc32/hc32_f4_series"
859+
CONFIG_PKG_USING_HC32F4_SERIES_DRIVER_LATEST_VERSION=y
860+
CONFIG_PKG_HC32F4_SERIES_DRIVER_VER="latest"
851861
# end of HC32 DDL Drivers
852862

853863
#

bsp/hc32/ev_hc32f448_lqfp80/SConstruct

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ except:
1515
print(RTT_ROOT)
1616
exit(-1)
1717

18+
def bsp_pkg_check():
19+
import subprocess
20+
21+
check_paths = [
22+
os.path.join("packages", "hc32-f4-cmsis-latest"),
23+
os.path.join("packages", "hc32-f4-series-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+
1837
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
1938

2039
DefaultEnvironment(tools=[])
@@ -47,11 +66,7 @@ Export('SDK_LIB')
4766
# prepare building environment
4867
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
4968

50-
hc32_library = 'hc32f448_ddl'
51-
rtconfig.BSP_LIBRARY_TYPE = hc32_library
52-
53-
# include libraries
54-
objs.extend(SConscript(os.path.join(libraries_path_prefix, hc32_library, 'SConscript')))
69+
rtconfig.BSP_LIBRARY_TYPE = None
5570

5671
# include drivers
5772
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'hc32_drivers', 'SConscript')))

bsp/hc32/ev_hc32f448_lqfp80/board/SConscript

Lines changed: 0 additions & 11 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
@@ -16,14 +13,6 @@ path = [cwd]
1613
path += [cwd + '/ports']
1714
path += [cwd + '/config']
1815

19-
startup_path_prefix = SDK_LIB
20-
21-
if rtconfig.PLATFORM in ['gcc']:
22-
src += [startup_path_prefix + '/hc32f448_ddl/cmsis/Device/HDSC/hc32f4xx/Source/GCC/startup_hc32f448.S']
23-
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
24-
src += [startup_path_prefix + '/hc32f448_ddl/cmsis/Device/HDSC/hc32f4xx/Source/ARM/startup_hc32f448.s']
25-
elif rtconfig.PLATFORM in ['iccarm']:
26-
src += [startup_path_prefix + '/hc32f448_ddl/cmsis/Device/HDSC/hc32f4xx/Source/IAR/startup_hc32f448.s']
2716

2817
CPPDEFINES = ['HC32F448', '__DEBUG']
2918
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)

0 commit comments

Comments
 (0)