diff options
| author | SummerGift <[email protected]> | 2020-05-06 15:32:53 +0800 |
|---|---|---|
| committer | SummerGift <[email protected]> | 2020-05-06 15:37:11 +0800 |
| commit | 36755af0be6b92f095702afa2fae6e0376a27681 (patch) | |
| tree | 5c1c56434419cf4e78275b45750aa0910ec9e259 | |
| parent | dbfd464a77ff213490d78b67af1146a326d43425 (diff) | |
[update] nuclei dist handle
| -rw-r--r-- | bsp/nuclei/gd32vf103_rvstar/rtconfig.py | 12 | ||||
| -rw-r--r-- | bsp/nuclei/tools/sdk_dist.py | 18 | ||||
| -rw-r--r-- | tools/mkdist.py | 7 |
3 files changed, 30 insertions, 7 deletions
diff --git a/bsp/nuclei/gd32vf103_rvstar/rtconfig.py b/bsp/nuclei/gd32vf103_rvstar/rtconfig.py index 8136b392f8..bf74338e8a 100644 --- a/bsp/nuclei/gd32vf103_rvstar/rtconfig.py +++ b/bsp/nuclei/gd32vf103_rvstar/rtconfig.py @@ -5,6 +5,9 @@ ARCH='risc-v' CPU='nuclei' CROSS_TOOL='gcc' +# bsp lib config +BSP_LIBRARY_TYPE = None + if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') @@ -18,7 +21,9 @@ else: # EXEC_PATH = os.getenv('RTT_EXEC_PATH') BUILD = 'debug' + # Fixed configurations below +NUCLEI_SDK_OPENOCD_CFG = "type in your config" NUCLEI_SDK_SOC = "gd32vf103" NUCLEI_SDK_BOARD = "gd32vf103v_rvstar" NUCLEI_SDK_DOWNLOAD = "flashxip" @@ -56,3 +61,10 @@ if PLATFORM == 'gcc': DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + +def dist_handle(BSP_ROOT): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT) diff --git a/bsp/nuclei/tools/sdk_dist.py b/bsp/nuclei/tools/sdk_dist.py new file mode 100644 index 0000000000..f802e92730 --- /dev/null +++ b/bsp/nuclei/tools/sdk_dist.py @@ -0,0 +1,18 @@ +import os +import sys +import shutil +cwd_path = os.getcwd() +sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools')) + +# BSP dist function +def dist_do_building(BSP_ROOT): + from mkdist import bsp_copy_files + import rtconfig + + dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT)) + library_dir = os.path.join(dist_dir, 'libraries') + + print("=> copy nuclei bsp library") + library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries') + library_dir = os.path.join(dist_dir, 'libraries') + bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE)) diff --git a/tools/mkdist.py b/tools/mkdist.py index e190123e6c..a6c744b470 100644 --- a/tools/mkdist.py +++ b/tools/mkdist.py @@ -336,13 +336,6 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None): print('=> %s' % os.path.basename(BSP_ROOT)) bsp_copy_files(BSP_ROOT, dist_dir) - # copy nuclei bsp libiary files - if os.path.basename(os.path.dirname(BSP_ROOT)) == 'nuclei': - print("=> copy nuclei bsp library") - library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries') - library_dir = os.path.join(dist_dir, 'libraries') - bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type'])) - # do bsp special dist handle if 'dist_handle' in Env: print("=> start dist handle") |
