Skip to content

Commit 567f2b8

Browse files
committed
add smart config
1 parent 63b7065 commit 567f2b8

File tree

4 files changed

+46
-21
lines changed

4 files changed

+46
-21
lines changed

.github/ALL_BSP_COMPILE.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
{
1313
"RTT_BSP": "others_ft32_mm32_acm32",
1414
"RTT_TOOL_CHAIN": "sourcery-arm",
15+
"RTT_SMART_TOOL_CHAIN": "arm-linux-musleabi",
1516
"SUB_RTT_BSP": [
16-
"qemu-vexpress-a9",
17-
"airm2m/air32f103"
17+
"qemu-vexpress-a9"
1818
]
1919
}
2020
]

.github/workflows/bsp_buildings.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ jobs:
208208
pip3 install esptool
209209
echo "RTT_EXEC_PATH=/opt/riscv32-esp-elf/bin" >> $GITHUB_ENV
210210
211+
- name: Install Arm Musl ToolChains
212+
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && matrix.legs.RTT_SMART_TOOL_CHAIN == 'arm-linux-musleabi' && success() }}
213+
shell: bash
214+
run: |
215+
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/arm-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2
216+
sudo tar xjf arm-linux-musleabi_for_x86_64-pc-linux-gnu_stable.tar.bz2 -C /opt
217+
/opt/arm-linux-musleabi_for_x86_64-pc-linux-gnu/bin/arm-linux-musleabi-gcc --version
218+
211219
- name: Install Simulator Tools
212220
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'gcc' && success() }}
213221
run: |

bsp/qemu-vexpress-a9/.ci/attachconfig/ci.attachconfig.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ bsp_board_info:
99
scons --version
1010
run_cmd: ./qemu-nographic.sh
1111
qemu_flag: true
12-
pkg.tools.coremark:
12+
# ------ PERIPHERAL CI ------
13+
peripheral.EMAC:
14+
kconfig:
15+
- CONFIG_BSP_DRV_EMAC=y
16+
peripheral.LVGL:
17+
kconfig:
18+
- CONFIG_RT_USING_POSIX_SOCKET=y
19+
- ONFIG_RT_USING_LWIP=y
20+
- CONFIG_BSP_USING_LVGL=y
21+
22+
# ------ online-packages CI ------
23+
online-packages.tools.coremark:
1324
kconfig:
1425
- CONFIG_PKG_USING_COREMARK=y
1526
- CONFIG_COREMARK_ITERATIONS=36000
@@ -27,26 +38,21 @@ pkg.tools.coremark:
2738
core_mark
2839
msh_cmd_timeout: 60
2940
checkresult: 'CoreMark 1.0' #检查执行过程中的log是否有匹配字
30-
# ------ PERIPHERAL CI ------
31-
peripheral.EMAC:
32-
kconfig:
33-
- CONFIG_BSP_DRV_EMAC=y
34-
peripheral.LVGL:
35-
kconfig:
36-
- CONFIG_RT_USING_POSIX_SOCKET=y
37-
- ONFIG_RT_USING_LWIP=y
38-
- CONFIG_BSP_USING_LVGL=y
39-
40-
# ------ online-packages CI ------
41+
4142
online-packages.misc.entertainment.tetris:
4243
kconfig:
4344
- CONFIG_PKG_USING_TETRIS=y
4445
online-packages.misc.entertainment.2048:
4546
kconfig:
4647
- CONFIG_PKG_USING_2048=y
47-
online-packages.ai.llmchat:
48+
# ------ RT_SMART PART ------
49+
rt_smart.base:
50+
env:
51+
RTT_CC_PREFIX: arm-linux-musleabi-
52+
RTT_EXEC_PATH: /opt/arm-linux-musleabi_for_x86_64-pc-linux-gnu/bin
53+
pre_build: |
54+
echo $RTT_CC_PREFIX
4855
kconfig:
49-
- CONFIG_WEBCLIENT_USING_MBED_TLS=y
50-
- CONFIG_BSP_DRV_EMAC=y
51-
- CONFIG_PKG_USING_LLMCHAT=y
52-
- CONFIG_PKG_LLM_API_KEY="sk-xxxxxx"
56+
- CONFIG_RT_USING_SMART=y
57+
- CONFIG_RT_USING_MEMHEAP=y
58+
- CONFIG_RT_USING_DFS_V2=y

tools/ci/bsp_buildings.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def run_cmd(cmd, output_info=True):
4141
return output_str_list, res
4242

4343

44-
def build_bsp(bsp, scons_args='',name='default', pre_build_commands=None, post_build_command=None,build_check_result = None):
44+
def build_bsp(bsp, scons_args='',name='default', pre_build_commands=None, post_build_command=None,build_check_result = None,bsp_build_env=None):
4545
"""
4646
build bsp.
4747
@@ -61,6 +61,12 @@ def build_bsp(bsp, scons_args='',name='default', pre_build_commands=None, post_b
6161
6262
"""
6363
success = True
64+
# 设置环境变量
65+
if bsp_build_env is not None:
66+
print("Setting environment variables:")
67+
for key, value in bsp_build_env.items():
68+
print(f"{key}={value}")
69+
os.environ[key] = value # 设置环境变量
6470
os.chdir(rtt_root)
6571
os.makedirs(f'{rtt_root}/output/bsp/{bsp}', exist_ok=True)
6672
if os.path.exists(f"{rtt_root}/bsp/{bsp}/Kconfig"):
@@ -73,6 +79,8 @@ def build_bsp(bsp, scons_args='',name='default', pre_build_commands=None, post_b
7379

7480
nproc = multiprocessing.cpu_count()
7581
if pre_build_commands is not None:
82+
print("Pre-build commands:")
83+
print(pre_build_commands)
7684
for command in pre_build_commands:
7785
print(command)
7886
output, returncode = run_cmd(command, output_info=True)
@@ -367,6 +375,7 @@ def check_output(output, check_string):
367375
build_check_result = None
368376
commands = None
369377
check_result = None
378+
bsp_build_env = None
370379
for projects in yml_files_content:
371380
for name, details in projects.items():
372381
# 如果是bsp_board_info,读取基本的信息
@@ -388,6 +397,8 @@ def check_output(output, check_string):
388397
ci_build_run_flag = details.get("ci_build_run_flag")
389398
if details.get("pre_build") is not None:
390399
pre_build_commands = details.get("pre_build").splitlines()
400+
if details.get("env") is not None:
401+
bsp_build_env = details.get("env")
391402
if details.get("build_cmd") is not None:
392403
build_command = details.get("build_cmd").splitlines()
393404
if details.get("post_build") is not None:
@@ -416,7 +427,7 @@ def check_output(output, check_string):
416427
print(f"::group::\tCompiling yml project: =={count}==={name}=scons_arg={scons_arg_str}==")
417428

418429
# #开始编译bsp
419-
res = build_bsp(bsp, scons_arg_str,name=name,pre_build_commands=pre_build_commands,post_build_command=post_build_command,build_check_result=build_check_result)
430+
res = build_bsp(bsp, scons_arg_str,name=name,pre_build_commands=pre_build_commands,post_build_command=post_build_command,build_check_result=build_check_result,bsp_build_env =bsp_build_env)
420431

421432
shutil.copyfile(config_bacakup, config_file)
422433
os.remove(config_bacakup)

0 commit comments

Comments
 (0)