浏览代码

[update] nuclei dist handle

SummerGift 5 年之前
父节点
当前提交
36755af0be
共有 3 个文件被更改,包括 30 次插入7 次删除
  1. 12 0
      bsp/nuclei/gd32vf103_rvstar/rtconfig.py
  2. 18 0
      bsp/nuclei/tools/sdk_dist.py
  3. 0 7
      tools/mkdist.py

+ 12 - 0
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)

+ 18 - 0
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))

+ 0 - 7
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")