cmake: detect RP2350 RISC-V core in rp2 platform automation - #158
Merged
ventZl merged 1 commit intoAug 20, 2026
Merged
Conversation
The rp2 platform-automation convenience path unconditionally forced ARM/CMSIS for every RP2xxx device string, including the RP2350 RISC-V (Hazard3) core, so anyone relying on it for a RISC-V project got silently misconfigured for the wrong architecture instead of a clear error. Detect the RISC-V core the same way the pico-sdk-riscv quirk already does and route it to the correct arch/HAL before any of the CMSIS-specific logic runs. Assisted-by: Claude Signed-off-by: Tobias Aguiar <tobi.aguiar01@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the rp2 platform automation to correctly detect and configure RP2350 RISC-V builds instead of silently forcing ARM/CMSIS for all RP2xxx devices.
Problem
The
cmake/platform/rp2.cmakemodule is the platform-automation convenience path for RP2xxx devices. Currently it unconditionally setsCMRX_ARCH arm/CMRX_HAL cmsisandincludes
FindCMSISfor every device matching therp2prefix, including RP2350 RISC-V. A project usingCMRX_DEVICE=rp2350withPICO_PLATFORM=rp2350-riscvwould be silentlymisconfigured for the wrong architecture instead of receiving a clear error.
(Note: the documented path and the unmerged integration-test reference project both bypass this automation and set
CMRX_ARCH/CMRX_HALdirectly, so no real build is currentlybroken. This fixes the convenience path for anyone who does use it.)
Changes
PICO_PLATFORM STREQUAL "rp2350-riscv", which sets the correctCMRX_ARCH riscv/CMRX_HAL haland returns immediately, before anyARM/CMSIS logic runs.
Testing
Verified with a dry cmake configure:
CMRX_DEVICE=rp2350,PICO_PLATFORM=rp2350-riscv(noPICO_SDK_PATHset) → correctly resolves toCMRX_ARCH=riscv/CMRX_HAL=hal, skipsPICO_SDK_PATHcheck, loads theRISC-V HAL module.
CMRX_DEVICE=rp2040(noPICO_PLATFORM) → reaches the samePICO_SDK_PATHcheck and linker-file logic as before, no regression.