🛠 Basculer les cœurs de Arm Cortex-M33 à Hazard3 RISC-V avec ARCHSEL

RP2350 (generic / RP2350-based boards) · intermediaire · Schéma : IMG-rp2350-generic-intermediaire-3-rp2350-archsel-riscv.svg — puce RP2350 coupée en deux moitiés, à gauche deux cœurs Cortex-M33 (Armv8-M), à droite deux cœurs Hazard3 (RV32IMAC), registre ARCHSEL et reset de cœur comme interrupteur entre les deux, terminal affichant le banner RISC-V

Objectives

Unique feature at this price point: the RP2350 contains two pairs of cores — two Arm Cortex-M33 (Armv8-M, TrustZone-M, DSP, single-precision FPU + double-precision coprocessor) OR two Hazard3 RISC-V (RV32IMAC) — but only one pair runs at a time. The selection is made via the ARCHSEL register, followed by a core reset: this allows switching architectures without re-powering the board (RP2350 datasheet, §1.1 and §3). This tutorial covers compiling the same "hello" program for RISC-V, understanding the role of the boot ROM, and measuring what each architecture offers.

Hardware

Full commands

# 1) Toolchain RISC-V dans le PATH
export PATH=$PWD/pico-sdk-tools/bin:$PATH
riscv32-unknown-elf-gcc --version    # doit répondre

# 2) Reconfigurer le projet en plateforme RISC-V
cd clignot/build
cmake -DPICO_PLATFORM=rp2350-riscv -DPICO_BOARD=pico2 ..
make -j

# 3) Flash (BOOTSEL ou picotool) puis lire la console
picotool load -x clignot.uf2     # ou drag-and-drop de l'UF2

On the register side, the hot switch is roughly written as:

// archsel.c — demander Hazard3 au prochain reset de cœur
// 1) écrire ARCHSEL=1 (registre de syscfg/PPB selon le datasheet §3)
// 2) déclencher le reset des cœurs : le boot ROM relit ARCHSEL
//    et libère la paire RISC-V au lieu de la paire Arm.
// 
// à utiliser selon ta version — cherche « ARCHSEL » dans pico-bootrom.

Expected verification

The RISC-V binary blinks and behaves identically: the SDK abstracts the architecture (PIO, GPIO, and USB are the same peripherals, and the 52 interrupt inputs are routed to both architectures). Run a micro-benchmark (dependent integer loop) on both sides: the M33 retains the advantage on standard C code (16/32-bit decoder, FPU), while the Hazard3 RV32IMAC holds its own on code footprint and multiplication (M extension). Switching Arm→RISC-V→Arm happens hot: same power supply, same XIP flash.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials