diff options
| author | Alessandro Gatti <a.gatti@frob.it> | 2025-11-10 23:14:15 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-12-19 17:06:53 +1100 |
| commit | ec5f2bc686a51aad903518c0f84d7d39d3b3432c (patch) | |
| tree | 16f32635e6495766f8c6063a978dfa7c9d3f2d87 | |
| parent | 08096392b58411c6b30031683af7d49760c19831 (diff) | |
rp2/CMakeLists.txt: Set the appropriate mpy-cross flags on all targets.
This commit lets the RP2 port build system use the appropriate flags to
pass to "mpy-cross" when building frozen MPY files as part of the build
process.
Now all possible variants (RP2040, RP2350/Arm, and RP2350/RV32) have
their right flags assigned, falling back the flags set of the RP2040 if
a new variant is introduced. Before these changes all variants would
use the RP2040 set of flags which may be a bit of an issue when building
code for the RP2350 in RV32 mode.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
| -rw-r--r-- | ports/rp2/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt index c4a081e2e..d88a96d4a 100644 --- a/ports/rp2/CMakeLists.txt +++ b/ports/rp2/CMakeLists.txt @@ -487,7 +487,16 @@ list(APPEND MICROPY_SOURCE_QSTR ) # Define mpy-cross flags -set(MICROPY_CROSS_FLAGS -march=armv6m) +if (${PICO_PLATFORM} STREQUAL "rp2040") + set(MICROPY_CROSS_FLAGS "-march=armv6m") +elseif (${PICO_PLATFORM} STREQUAL "rp2350-arm-s") + set(MICROPY_CROSS_FLAGS "-march=armv7m") +elseif (${PICO_PLATFORM} STREQUAL "rp2350-riscv") + set(MICROPY_CROSS_FLAGS "-march=rv32imc -march-flags=zba,zcmp") +else() + message(WARNING "Unknown PICO_PLATFORM version (${PICO_PLATFORM}), falling back to rp2040") + set(MICROPY_CROSS_FLAGS "-march=armv6m") +endif() # Set the frozen manifest file if (MICROPY_USER_FROZEN_MANIFEST) |
