Skip to content

Commit 36755af

Browse files
committed
[update] nuclei dist handle
1 parent dbfd464 commit 36755af

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

bsp/nuclei/gd32vf103_rvstar/rtconfig.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
CPU='nuclei'
66
CROSS_TOOL='gcc'
77

8+
# bsp lib config
9+
BSP_LIBRARY_TYPE = None
10+
811
if os.getenv('RTT_CC'):
912
CROSS_TOOL = os.getenv('RTT_CC')
1013

@@ -18,7 +21,9 @@
1821
# EXEC_PATH = os.getenv('RTT_EXEC_PATH')
1922

2023
BUILD = 'debug'
24+
2125
# Fixed configurations below
26+
NUCLEI_SDK_OPENOCD_CFG = "type in your config"
2227
NUCLEI_SDK_SOC = "gd32vf103"
2328
NUCLEI_SDK_BOARD = "gd32vf103v_rvstar"
2429
NUCLEI_SDK_DOWNLOAD = "flashxip"
@@ -56,3 +61,10 @@
5661

5762
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
5863
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
64+
65+
def dist_handle(BSP_ROOT):
66+
import sys
67+
cwd_path = os.getcwd()
68+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
69+
from sdk_dist import dist_do_building
70+
dist_do_building(BSP_ROOT)

bsp/nuclei/tools/sdk_dist.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import sys
3+
import shutil
4+
cwd_path = os.getcwd()
5+
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
6+
7+
# BSP dist function
8+
def dist_do_building(BSP_ROOT):
9+
from mkdist import bsp_copy_files
10+
import rtconfig
11+
12+
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
13+
library_dir = os.path.join(dist_dir, 'libraries')
14+
15+
print("=> copy nuclei bsp library")
16+
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
17+
library_dir = os.path.join(dist_dir, 'libraries')
18+
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

tools/mkdist.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,6 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
336336
print('=> %s' % os.path.basename(BSP_ROOT))
337337
bsp_copy_files(BSP_ROOT, dist_dir)
338338

339-
# copy nuclei bsp libiary files
340-
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'nuclei':
341-
print("=> copy nuclei bsp library")
342-
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
343-
library_dir = os.path.join(dist_dir, 'libraries')
344-
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
345-
346339
# do bsp special dist handle
347340
if 'dist_handle' in Env:
348341
print("=> start dist handle")

0 commit comments

Comments
 (0)