From b1b5e2a8642c3e8cef6cbdc50bee0c0314c462b6 Mon Sep 17 00:00:00 2001 From: Tobias Aguiar Date: Tue, 18 Aug 2026 07:15:18 +0200 Subject: [PATCH 1/4] ci: add RP2350 RISC-V build workflow Creates a GitHub Actions workflow for automated building of the RP2350 RISC-V integration test project, mirroring the rp2040 workflow but using the RISC-V toolchain from pico-sdk-tools and configuring for the Hazard3 core. Assisted-by: Claude Signed-off-by: Tobias Aguiar --- .github/workflows/rp2350-riscv-build.yml | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/rp2350-riscv-build.yml diff --git a/.github/workflows/rp2350-riscv-build.yml b/.github/workflows/rp2350-riscv-build.yml new file mode 100644 index 0000000..57b8041 --- /dev/null +++ b/.github/workflows/rp2350-riscv-build.yml @@ -0,0 +1,72 @@ +name: 'Build: rp2350-riscv' + +on: + pull_request: + push: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build-project: + runs-on: ubuntu-latest + steps: + - name: Prepare RISC-V Cross-Toolchain + run: | + curl -L -o /tmp/riscv-toolchain.tar.gz \ + https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.3.0-1/riscv-toolchain-16-x86_64-lin.tar.gz + mkdir -p "$HOME/riscv-toolchain" + tar -xzf /tmp/riscv-toolchain.tar.gz -C "$HOME/riscv-toolchain" + echo "$HOME/riscv-toolchain/bin" >> "$GITHUB_PATH" + echo "PICO_TOOLCHAIN_PATH=$HOME/riscv-toolchain" >> "$GITHUB_ENV" + + - name: Checkout repository + uses: actions/checkout@v4.1.6 + with: + fetch-depth: 0 + + - name: Checkout Integration Tests + uses: actions/checkout@v4.1.6 + with: + repository: ventZl/cmrx-integration-tests + path: _integ + + - name: Checkout Raspberry Pi Pico SDK + uses: actions/checkout@v4.1.6 + with: + repository: raspberrypi/pico-sdk + ref: 2.2.0 + path: _integ/rp2350-pico-sdk-riscv/pico-sdk + + - name: Link CMRX source + run: rm -rf _integ/rp2350-pico-sdk-riscv/cmrx && ln -s $GITHUB_WORKSPACE _integ/rp2350-pico-sdk-riscv/cmrx + + - name: Configure Integration Test Build + uses: threeal/cmake-action@main + with: + run-build: false + source-dir: _integ/rp2350-pico-sdk-riscv + build-dir: build + args: -DCMRX_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=rp2350-riscv -DPICO_BOARD=pico2 -DPICO_SDK_PATH=${{github.workspace}}/_integ/rp2350-pico-sdk-riscv/pico-sdk -DPICO_TOOLCHAIN_PATH=${{env.PICO_TOOLCHAIN_PATH}} -DPICO_GCC_TRIPLE=riscv32-pico-elf + + - name: Build Integration Test + run: make -C build + continue-on-error: true + + - name: Generate RP2350 memory regions + run: | + printf 'MEMORY\n{\n FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 2048k\n RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512k\n SCRATCH (rwx): ORIGIN = 0x20080000, LENGTH = 4k\n}\n' > build/rp2350_riscv_memory.ld + + - name: Run MemBrowse analysis + uses: membrowse/membrowse-action@v1 + with: + target_name: rp2350-riscv + elf: build/rp2350_riscv_cmrx.elf + ld: build/rp2350_riscv_memory.ld + map_file: build/rp2350_riscv_cmrx.map + api_key: ${{ secrets.MEMBROWSE_API_KEY }} + api_url: ${{ vars.MEMBROWSE_API_URL }} + verbose: INFO From 3d98184dd451a0d2059c3f5b45d6fd223cd7a5d7 Mon Sep 17 00:00:00 2001 From: Tobias Aguiar Date: Tue, 18 Aug 2026 07:16:51 +0200 Subject: [PATCH 2/4] ci: add rp2350-riscv target to MemBrowse matrix Register the RP2350 RISC-V target in membrowse-targets.json so it can be invoked manually via the membrowse-onboard workflow. Includes build command with the RISC-V configure flags, memory region generation, and artifact paths matching the primary build workflow. Assisted-by: Claude Signed-off-by: Tobias Aguiar --- .github/membrowse-targets.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/membrowse-targets.json b/.github/membrowse-targets.json index b4bd14d..617ad8f 100644 --- a/.github/membrowse-targets.json +++ b/.github/membrowse-targets.json @@ -20,12 +20,21 @@ { "target_name": "rp2040", "source_dir": "rp2040-pico-sdk", - "build_cmd": "cmake -S _integ/rp2040-pico-sdk -B build -DCMRX_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DPICO_SDK_PATH=$GITHUB_WORKSPACE/_integ/rp2040-pico-sdk/pico-sdk && (cmake --build build || true) && cmake --build build && printf 'MEMORY {\\n FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048K\\n RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k\\n SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k\\n SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k\\n}\\n' > build/rp2040_memory.ld", + "build_cmd": "cmake -S _integ/rp2040-pico-sdk -B build -DCMRX_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DPICO_TOOLCHAIN_PATH=$HOME/riscv-toolchain -DPICO_SDK_PATH=$GITHUB_WORKSPACE/_integ/rp2040-pico-sdk/pico-sdk && (cmake --build build || true) && cmake --build build && printf 'MEMORY {\\n FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048K\\n RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k\\n SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k\\n SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k\\n}\\n' > build/rp2040_memory.ld", "elf": "build/helloworld.elf", "ld": "build/rp2040_memory.ld", "map_file": "build/helloworld.map", "linker_vars": "" }, + { + "target_name": "rp2350-riscv", + "source_dir": "rp2350-pico-sdk-riscv", + "build_cmd": "cd $GITHUB_WORKSPACE/_integ/rp2350-pico-sdk-riscv && cmake -S . -B build -DCMRX_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DPICO_PLATFORM=rp2350-riscv -DPICO_BOARD=pico2 -DPICO_SDK_PATH=$GITHUB_WORKSPACE/_integ/rp2350-pico-sdk-riscv/pico-sdk && (cmake --build build || true) && cmake --build build && printf 'MEMORY\n{\n FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 2048k\n RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512k\n SCRATCH (rwx): ORIGIN = 0x20080000, LENGTH = 4k\n}\n' > build/rp2350_riscv_memory.ld", + "elf": "build/rp2350_riscv_cmrx.elf", + "ld": "build/rp2350_riscv_memory.ld", + "map_file": "build/rp2350_riscv_cmrx.map", + "linker_vars": "" + }, { "target_name": "linux", "source_dir": "linux-posix", From 5f2dc1a3f5c4930f0251de4004b1361035587c20 Mon Sep 17 00:00:00 2001 From: Tobias Aguiar Date: Tue, 18 Aug 2026 07:18:23 +0200 Subject: [PATCH 3/4] ci: add RISC-V toolchain branch to membrowse-onboard workflow Extend the MemBrowse dispatcher workflow to handle RP2350 RISC-V builds: - Narrow ARM toolchain condition to exclude rp2350-riscv - Add new RISC-V toolchain installation step (curl v2.3.0-1, extract to PATH) - Gate Pico SDK checkout to rp2040 and rp2350-riscv, with matrix-driven path so each target checks out to the correct integration project directory Assisted-by: Claude Signed-off-by: Tobias Aguiar --- .github/workflows/membrowse-onboard.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/membrowse-onboard.yml b/.github/workflows/membrowse-onboard.yml index 6b45eaa..122961c 100644 --- a/.github/workflows/membrowse-onboard.yml +++ b/.github/workflows/membrowse-onboard.yml @@ -37,11 +37,20 @@ jobs: fetch-depth: 0 - name: Prepare Cross-Toolchain Environment - if: matrix.target_name != 'linux' + if: matrix.target_name != 'linux' && matrix.target_name != 'rp2350-riscv' uses: carlosperate/arm-none-eabi-gcc-action@v1 with: release: '12.2.Rel1' + - name: Prepare RISC-V Cross-Toolchain + if: matrix.target_name == 'rp2350-riscv' + run: | + curl -L -o /tmp/riscv-toolchain.tar.gz \ + https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.3.0-1/riscv-toolchain-16-x86_64-lin.tar.gz + mkdir -p "$HOME/riscv-toolchain" + tar -xzf /tmp/riscv-toolchain.tar.gz -C "$HOME/riscv-toolchain" + echo "$HOME/riscv-toolchain/bin" >> "$GITHUB_PATH" + - name: Checkout Integration Tests uses: actions/checkout@v4.1.6 with: @@ -49,11 +58,11 @@ jobs: path: _integ - name: Checkout Raspberry Pi Pico SDK - if: matrix.target_name == 'rp2040' + if: matrix.target_name == 'rp2040' || matrix.target_name == 'rp2350-riscv' uses: actions/checkout@v4.1.6 with: repository: raspberrypi/pico-sdk - path: _integ/rp2040-pico-sdk/pico-sdk + path: _integ/${{ matrix.source_dir }}/pico-sdk - name: Link CMRX source run: rm -rf _integ/${{ matrix.source_dir }}/cmrx && ln -s $GITHUB_WORKSPACE _integ/${{ matrix.source_dir }}/cmrx From 964fe44d39b976061a7b7aae740a0fccea204e59 Mon Sep 17 00:00:00 2001 From: Tobias Aguiar Date: Tue, 18 Aug 2026 07:19:12 +0200 Subject: [PATCH 4/4] docs: add RP2350 RISC-V CI badge to README Add a build-status badge for the rp2350-riscv workflow to the top-level README, consistent with existing build badges for other platforms (rp2040, stm32g4, stm32h7, linux). Give users and developers visibility into the RISC-V port's CI status. Assisted-by: Claude Signed-off-by: Tobias Aguiar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43b8313..87a1b2a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ CMRX - Microkernel RTOS for microcontrollers ============================================ -![unit tests](https://github.com/ventZl/cmrx/actions/workflows/unit_tests.yml/badge.svg) [![Clang-Tidy](https://github.com/ventZl/cmrx/actions/workflows/clang_tidy.yml/badge.svg?branch=master)](https://github.com/ventZl/cmrx/actions/workflows/clang_tidy.yml) ![stm32h7 build](https://github.com/ventZl/cmrx/actions/workflows/stm32h7-build.yml/badge.svg) ![stm32g4 build](https://github.com/ventZl/cmrx/actions/workflows/stm32g4-build.yml/badge.svg) ![rp2040 build](https://github.com/ventZl/cmrx/actions/workflows/rp2040-build.yml/badge.svg) [![Linux build](https://github.com/ventZl/cmrx/actions/workflows/linux-build.yml/badge.svg)](https://github.com/ventZl/cmrx/actions/workflows/linux-build.yml) [![MemBrowse](https://membrowse.com/badge.svg)](https://membrowse.com/public/ventZl/cmrx) +![unit tests](https://github.com/ventZl/cmrx/actions/workflows/unit_tests.yml/badge.svg) [![Clang-Tidy](https://github.com/ventZl/cmrx/actions/workflows/clang_tidy.yml/badge.svg?branch=master)](https://github.com/ventZl/cmrx/actions/workflows/clang_tidy.yml) ![stm32h7 build](https://github.com/ventZl/cmrx/actions/workflows/stm32h7-build.yml/badge.svg) ![stm32g4 build](https://github.com/ventZl/cmrx/actions/workflows/stm32g4-build.yml/badge.svg) ![rp2040 build](https://github.com/ventZl/cmrx/actions/workflows/rp2040-build.yml/badge.svg) ![rp2350-riscv build](https://github.com/ventZl/cmrx/actions/workflows/rp2350-riscv-build.yml/badge.svg) [![Linux build](https://github.com/ventZl/cmrx/actions/workflows/linux-build.yml/badge.svg)](https://github.com/ventZl/cmrx/actions/workflows/linux-build.yml) [![MemBrowse](https://membrowse.com/badge.svg)](https://membrowse.com/public/ventZl/cmrx) **Table of Contents** - [About](#about)