diff --git a/.github/workflows/bsp_buildings.yml b/.github/workflows/bsp_buildings.yml index 73a5dea700b..81dddf5a80d 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 @@ -41,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" @@ -433,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() }} @@ -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/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' diff --git a/bsp/yichip/yc3121-pos/Libraries/core/type.h b/bsp/yichip/yc3121-pos/Libraries/core/type.h index 112f0374e66..40a32a0de59 100644 --- a/bsp/yichip/yc3121-pos/Libraries/core/type.h +++ b/bsp/yichip/yc3121-pos/Libraries/core/type.h @@ -23,16 +23,17 @@ 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 -/** +/** * @brief __NOINLINE definition - */ + */ #if defined ( __CC_ARM ) || defined ( __GNUC__ ) -/* ARM & GNUCompiler - ---------------- +/* ARM & GNUCompiler + ---------------- */ #define __NOINLINE noinline diff --git a/tools/ci/bsp_buildings.py b/tools/ci/bsp_buildings.py index 8b182df63df..8ba412a779d 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. @@ -57,6 +57,7 @@ def build_bsp(bsp, scons_args=''): """ 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) @@ -67,18 +68,23 @@ def build_bsp(bsp, scons_args=''): 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: success = False + 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.replace("/", "_")}.{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 +151,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) shutil.copyfile(config_bacakup, config_file) os.remove(config_bacakup) @@ -220,7 +226,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.')