From 41ebd5eb41c9ab87d296555d6696b5530de91156 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 11:13:33 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[action/ci]=20=E6=8A=8A=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E7=BB=93=E6=9E=9C=E4=B8=8A=E4=BC=A0=E5=88=B0?= =?UTF-8?q?github?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bsp_buildings.yml | 17 +++++++++++++++++ tools/ci/bsp_buildings.py | 16 ++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bsp_buildings.yml b/.github/workflows/bsp_buildings.yml index 73a5dea700b..cf3f15cdd86 100644 --- a/.github/workflows/bsp_buildings.yml +++ b/.github/workflows/bsp_buildings.yml @@ -1,3 +1,12 @@ +# +# Copyright (c) 2025, RT-Thread Development Team +# +# SPDX-License-Identifier: Apache-2.0 +# +# Change Logs: +# Date Author Notes +# 2025-03-22 Supperthomas 添加upload 上传编译固件 +# name: RT-Thread BSP Static Build Check # Controls when the action will run. Triggers the workflow on push or pull request @@ -536,6 +545,14 @@ jobs: source ~/.env/env.sh python tools/ci/bsp_buildings.py + - name: Upload output as artifact + if: ${{ success() }} + uses: actions/upload-artifact@main + with: + name: ${{ matrix.legs.RTT_BSP }} + if-no-files-found: ignore + path: output/ + - name: Post failure comment if: failure() run: | diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 8b182df63df..9c514b06a58 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -36,7 +36,7 @@ def run_cmd(cmd, output_info=True): return output_str_list, res -def build_bsp(bsp, scons_args=''): +def build_bsp(bsp, scons_args='',name='default'): """ build bsp. @@ -72,13 +72,17 @@ def build_bsp(bsp, scons_args=''): if res != 0: success = False + #拷贝当前的文件夹下面的所有以elf结尾的文件拷贝到rt-thread/output文件夹下 + import glob + # 拷贝编译生成的文件到output目录,文件拓展为 elf,bin,hex + for file_type in ['*.elf', '*.bin', '*.hex']: + files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') + for file in files: + shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name}.{file_type[2:]}') os.chdir(f'{rtt_root}/bsp/{bsp}') run_cmd('scons -c', output_info=False) - #pkg_dir = os.path.join(rtt_root, 'bsp', bsp, 'packages') - #shutil.rmtree(pkg_dir, ignore_errors=True) - return success @@ -145,7 +149,7 @@ def build_bsp_attachconfig(bsp, attach_file): scons_args = check_scons_args(attach_path) - res = build_bsp(bsp, scons_args) + res = build_bsp(bsp, scons_args,name=attach_file.tostring()) shutil.copyfile(config_bacakup, config_file) os.remove(config_bacakup) @@ -220,7 +224,7 @@ def build_bsp_attachconfig(bsp, attach_file): scons_arg.append(line) scons_arg_str=' '.join(scons_arg) if scons_arg else ' ' print(f"::group::\tCompiling yml project: =={count}==={name}=scons_arg={scons_arg_str}==") - res = build_bsp(bsp, scons_arg_str) + res = build_bsp(bsp, scons_arg_str,name=name) if not res: print(f"::error::build {bsp} {name} failed.") add_summary(f'\t- ❌ build {bsp} {name} failed.') From 5ae9f7d324836e0187137ee47543ee5726395a12 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 11:37:40 +0800 Subject: [PATCH 02/10] [fix] --- tools/ci/bsp_buildings.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 9c514b06a58..0275f37f9c1 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -72,13 +72,14 @@ def build_bsp(bsp, scons_args='',name='default'): if res != 0: success = False - #拷贝当前的文件夹下面的所有以elf结尾的文件拷贝到rt-thread/output文件夹下 - import glob - # 拷贝编译生成的文件到output目录,文件拓展为 elf,bin,hex - for file_type in ['*.elf', '*.bin', '*.hex']: - files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') - for file in files: - shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name}.{file_type[2:]}') + else: + #拷贝当前的文件夹下面的所有以elf结尾的文件拷贝到rt-thread/output文件夹下 + import glob + # 拷贝编译生成的文件到output目录,文件拓展为 elf,bin,hex + for file_type in ['*.elf', '*.bin', '*.hex']: + files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') + for file in files: + shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name}.{file_type[2:]}') os.chdir(f'{rtt_root}/bsp/{bsp}') run_cmd('scons -c', output_info=False) From f09b481f577e363317549128fe6da89c7cd491d0 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 11:58:50 +0800 Subject: [PATCH 03/10] add output --- tools/ci/bsp_buildings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 0275f37f9c1..a788039e2db 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -57,6 +57,7 @@ def build_bsp(bsp, scons_args='',name='default'): """ success = True os.chdir(rtt_root) + os.makedirs(f'{rtt_root}/output/bsp/{bsp}', exist_ok=True) if os.path.exists(f"{rtt_root}/bsp/{bsp}/Kconfig"): os.chdir(rtt_root) run_cmd(f'scons -C bsp/{bsp} --pyconfig-silent', output_info=False) From f60319958b6bdbbd6644f050bb6dc83b68774d07 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 12:03:47 +0800 Subject: [PATCH 04/10] fix --- tools/ci/bsp_buildings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index a788039e2db..d40f0cd782f 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -68,7 +68,7 @@ def build_bsp(bsp, scons_args='',name='default'): nproc = multiprocessing.cpu_count() os.chdir(rtt_root) - cmd = f'scons -C bsp/{bsp} -j{nproc} {scons_args} --debug=time' + cmd = f'scons -C bsp/{bsp} -j{nproc} {scons_args}' # --debug=time for debug time __, res = run_cmd(cmd, output_info=True) if res != 0: @@ -151,7 +151,7 @@ def build_bsp_attachconfig(bsp, attach_file): scons_args = check_scons_args(attach_path) - res = build_bsp(bsp, scons_args,name=attach_file.tostring()) + res = build_bsp(bsp, scons_args,name=attach_file) shutil.copyfile(config_bacakup, config_file) os.remove(config_bacakup) From 4571a887db06fd8c5b4d756ef8672e92f852fc7a Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 12:17:03 +0800 Subject: [PATCH 05/10] fixthe attach_file_name --- tools/ci/bsp_buildings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index d40f0cd782f..7932d98f66f 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -80,7 +80,7 @@ def build_bsp(bsp, scons_args='',name='default'): for file_type in ['*.elf', '*.bin', '*.hex']: files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') for file in files: - shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name}.{file_type[2:]}') + shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name.Replace("/", "_")}.{file_type[2:]}') os.chdir(f'{rtt_root}/bsp/{bsp}') run_cmd('scons -c', output_info=False) From cb324948988f9eb69324f85b37a2f34950d41915 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 12:20:54 +0800 Subject: [PATCH 06/10] fix --- tools/ci/bsp_buildings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 7932d98f66f..8ba412a779d 100644 --- a/tools/ci/bsp_buildings.py +++ b/tools/ci/bsp_buildings.py @@ -80,7 +80,7 @@ def build_bsp(bsp, scons_args='',name='default'): for file_type in ['*.elf', '*.bin', '*.hex']: files = glob.glob(f'{rtt_root}/bsp/{bsp}/{file_type}') for file in files: - shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name.Replace("/", "_")}.{file_type[2:]}') + shutil.copy(file, f'{rtt_root}/output/bsp/{bsp}/{name.replace("/", "_")}.{file_type[2:]}') os.chdir(f'{rtt_root}/bsp/{bsp}') run_cmd('scons -c', output_info=False) From e58806f81c5d8e0d0d8be797276b471524773cc3 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 12:30:27 +0800 Subject: [PATCH 07/10] fix name --- .github/workflows/bsp_buildings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bsp_buildings.yml b/.github/workflows/bsp_buildings.yml index cf3f15cdd86..bcd98756cb9 100644 --- a/.github/workflows/bsp_buildings.yml +++ b/.github/workflows/bsp_buildings.yml @@ -50,11 +50,11 @@ jobs: RTT_TOOL_CHAIN: "sourcery-arm" SUB_RTT_BSP: - "stm32/stm32f407-rt-spark" - - RTT_BSP: "RTduino/Arduino Libraries (STM32F412 Nucleo)" + - RTT_BSP: "RTduino_Arduino Libraries (STM32F412 Nucleo)" RTT_TOOL_CHAIN: "sourcery-arm" SUB_RTT_BSP: - "stm32/stm32f412-st-nucleo" - - RTT_BSP: "RTduino/Arduino Libraries (Raspberry Pico)" + - RTT_BSP: "RTduino_Arduino Libraries (Raspberry Pico)" RTT_TOOL_CHAIN: "sourcery-arm" SUB_RTT_BSP: - "raspberry-pico" From c79ecd1c8dfe00baa8cb18b684785ac753d432dd Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 23:08:17 +0800 Subject: [PATCH 08/10] =?UTF-8?q?[action]=20=E6=9B=B4=E6=96=B0=E4=B8=80?= =?UTF-8?q?=E4=B8=8Btoolchain=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bsp_buildings.yml | 12 ++++++------ bsp/yichip/yc3121-pos/Libraries/core/type.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bsp_buildings.yml b/.github/workflows/bsp_buildings.yml index bcd98756cb9..81dddf5a80d 100644 --- a/.github/workflows/bsp_buildings.yml +++ b/.github/workflows/bsp_buildings.yml @@ -442,22 +442,22 @@ jobs: id: cache-gcc-arm uses: actions/cache@main with: - path: /opt/gcc-arm-none-eabi-10-2020-q4-major - key: ${{ runner.os }}-arm-none-eabi-10-2020-q4-major + path: /opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi + key: ${{ runner.os }}-arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi - name: Download Arm ToolChains if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && (steps.cache-gcc-arm.outputs.cache-hit != 'true') }} shell: bash run: | - wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt + wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.8/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz + sudo tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz -C /opt - name: Install Arm ToolChains2 if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm'}} shell: bash run: | - /opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version - echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV + /opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc --version + echo "RTT_EXEC_PATH=/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_ENV - name: Install LLVM-Arm ToolChains if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'llvm-arm' && success() }} diff --git a/bsp/yichip/yc3121-pos/Libraries/core/type.h b/bsp/yichip/yc3121-pos/Libraries/core/type.h index 112f0374e66..29afab3f168 100644 --- a/bsp/yichip/yc3121-pos/Libraries/core/type.h +++ b/bsp/yichip/yc3121-pos/Libraries/core/type.h @@ -23,6 +23,7 @@ typedef signed int int32_t; typedef signed long long int64_t; #else #include "stdio.h" +#include "stdint.h" typedef unsigned char byte; typedef unsigned short word; #endif From 0d2dda6eaf304b2b4ab3486827ef30e183187e99 Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 23:29:05 +0800 Subject: [PATCH 09/10] =?UTF-8?q?[bsp/stm32]=20hex=20=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/nrf5x/nrf52833/rtconfig.py | 3 ++- bsp/nrf5x/nrf52840/rtconfig.py | 3 ++- bsp/stm32/stm32f103-blue-pill/rtconfig.py | 3 ++- bsp/stm32/stm32f407-rt-spark/rtconfig.py | 2 +- bsp/stm32/stm32h750-artpi/rtconfig.py | 3 ++- bsp/stm32/stm32l496-st-nucleo/rtconfig.py | 1 + bsp/stm32/stm32wb55-st-nucleo/rtconfig.py | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bsp/nrf5x/nrf52833/rtconfig.py b/bsp/nrf5x/nrf52833/rtconfig.py index 315f21a833d..51d53735c33 100644 --- a/bsp/nrf5x/nrf52833/rtconfig.py +++ b/bsp/nrf5x/nrf52833/rtconfig.py @@ -55,7 +55,8 @@ CFLAGS += ' -O2' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' + elif PLATFORM == 'armcc': # toolchains CC = 'armcc' diff --git a/bsp/nrf5x/nrf52840/rtconfig.py b/bsp/nrf5x/nrf52840/rtconfig.py index 315f21a833d..51d53735c33 100644 --- a/bsp/nrf5x/nrf52840/rtconfig.py +++ b/bsp/nrf5x/nrf52840/rtconfig.py @@ -55,7 +55,8 @@ CFLAGS += ' -O2' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' + elif PLATFORM == 'armcc': # toolchains CC = 'armcc' diff --git a/bsp/stm32/stm32f103-blue-pill/rtconfig.py b/bsp/stm32/stm32f103-blue-pill/rtconfig.py index 43685c9070e..5334a94faa1 100644 --- a/bsp/stm32/stm32f103-blue-pill/rtconfig.py +++ b/bsp/stm32/stm32f103-blue-pill/rtconfig.py @@ -60,7 +60,8 @@ CXXFLAGS = CFLAGS POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' + elif PLATFORM == 'armcc': # toolchains CC = 'armcc' diff --git a/bsp/stm32/stm32f407-rt-spark/rtconfig.py b/bsp/stm32/stm32f407-rt-spark/rtconfig.py index d431276b007..41c4b00ffb7 100644 --- a/bsp/stm32/stm32f407-rt-spark/rtconfig.py +++ b/bsp/stm32/stm32f407-rt-spark/rtconfig.py @@ -63,7 +63,7 @@ CXXFLAGS = CFLAGS - POST_ACTION = OBJCPY + ' -O ihex $TARGET rtthread.hex\n' + SIZE + ' $TARGET \n' + POST_ACTION = OBJCPY + ' -O ihex $TARGET rtthread.hex\n' POST_ACTION += OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' elif PLATFORM == 'armcc': diff --git a/bsp/stm32/stm32h750-artpi/rtconfig.py b/bsp/stm32/stm32h750-artpi/rtconfig.py index 81c7b3bca0c..8db22e414c4 100644 --- a/bsp/stm32/stm32h750-artpi/rtconfig.py +++ b/bsp/stm32/stm32h750-artpi/rtconfig.py @@ -61,7 +61,8 @@ CFLAGS += ' -std=gnu99' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' + elif PLATFORM == 'armcc': # toolchains CC = 'armcc' diff --git a/bsp/stm32/stm32l496-st-nucleo/rtconfig.py b/bsp/stm32/stm32l496-st-nucleo/rtconfig.py index 854005af192..9a9ac18d55d 100644 --- a/bsp/stm32/stm32l496-st-nucleo/rtconfig.py +++ b/bsp/stm32/stm32l496-st-nucleo/rtconfig.py @@ -61,6 +61,7 @@ CXXFLAGS = CFLAGS POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' elif PLATFORM == 'armcc': # toolchains diff --git a/bsp/stm32/stm32wb55-st-nucleo/rtconfig.py b/bsp/stm32/stm32wb55-st-nucleo/rtconfig.py index c1f50801663..2ce12f4a175 100644 --- a/bsp/stm32/stm32wb55-st-nucleo/rtconfig.py +++ b/bsp/stm32/stm32wb55-st-nucleo/rtconfig.py @@ -60,7 +60,7 @@ CXXFLAGS = CFLAGS POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - + POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n' elif PLATFORM == 'armcc': # toolchains CC = 'armcc' From c2748c3a5f314ecdc4a11b8ea9ce38ab653c680b Mon Sep 17 00:00:00 2001 From: Supper Thomas <78900636@qq.com> Date: Sat, 22 Mar 2025 23:37:34 +0800 Subject: [PATCH 10/10] Update type.h --- bsp/yichip/yc3121-pos/Libraries/core/type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bsp/yichip/yc3121-pos/Libraries/core/type.h b/bsp/yichip/yc3121-pos/Libraries/core/type.h index 29afab3f168..40a32a0de59 100644 --- a/bsp/yichip/yc3121-pos/Libraries/core/type.h +++ b/bsp/yichip/yc3121-pos/Libraries/core/type.h @@ -28,12 +28,12 @@ typedef unsigned char byte; typedef unsigned short word; #endif -/** +/** * @brief __NOINLINE definition - */ + */ #if defined ( __CC_ARM ) || defined ( __GNUC__ ) -/* ARM & GNUCompiler - ---------------- +/* ARM & GNUCompiler + ---------------- */ #define __NOINLINE noinline