Updated 2024-10-26:
- compilers/linkers tested
- config files
RP2350 Support
This change note outlines first steps and some groundwork towards supporting the RP2350 micro-controller and the Pico 2 board. The RP2350 is a pretty advanced chip compared to the RP2040, so it will take some time to figure things out in-depth. The RP2350 implements the ARMv8-M Mainline architecture, which is a pretty different beast compared to the RP2040’s ARMv6-M features.
In the meantime, all current framework modules and tools for the RP2040 are still available, see below.
The RP2040 provides plus ou moins a subset of the RP2350 features, which means one of the goals for Oberon RTK should be to be able to use the same framework modules for that functionality subset. In fact, code for the RP2040 can be executed on the RP2350 – see below –, albeit using the latter’s address map, which is different from the RP2040, so rebuilding is required.
New MCU2.mod
The address map is represented via module MCU2
. Hence, I have started to create this module for the RP2350, but also a new version for the RP2040, with both modules strongly synchronised regarding structure and also the naming of the different items. This should simplify the development – or adaptation – of the framework modules so that they can – as far as possible and reasonable – be used for both chips, since the two MCU2s
“catch” the differences right at the definition level.
Repo Structure
There’s a new library directory tree for the forthcoming work on this adapted version 2 of Oberon RTK.
+ libv2
+ any
+ board
+ rpi
+ any
+ pico
+ pico2
+ mcu
+ rpi
+ any
+ RP2040
+ RP2350
This is where the future development work will take place. The rpi
level leaves the possibility to support also MCUs and boards from STM or other vendors, but that’s not high on the todo list.
The current modules (v1) remain in directory lib
and below.
The config
directory is now structured thusly:
+ config
+ v1: the existing config files
+ v2: new config files for the new lib directory structure and Astrobe settings
+ m0: for Astrobe for Cortex-M0
+ pico-base.ini (RP2040)
+ pico2-base.ini (RP2350)
+ rp2040: for Astrobe for RP2040, professional edition
+ pico-base.ini
+ pico2-base.ini
+ rp2040se: for Astrobe for RP2040, starter edition
+ pico-base.ini
+ pico2-base.ini
+ m4: for Astrobe for Cortex-M4
+ pico2-base.ini
Rebuild
in lieu of just Build
the program.
Running RP2040 Code
In order to get hands-on experience and know-how with the new MCU, and all aspects regarding developing for both chips, I wanted to get RP2040 code running on the RP2350 as quickly as possible, in particular the example program BlinkPlus
, which the most simple example program running on both cores from the beginning of this year.
For this, I have copied over to the new directory structure all basic framework modules required for BlinkPlus
, and then made the minimum adjustments and extensions as required by the new MCU2 modules for the RP2040 and RP2350 as outlined above, also taking any hardware changes in the new chip into account. As of now, most modules are actually in the rpi/any
directory, which contains the common code for both MCUs, but this may well change.
With the new MCU2
modules (RP2040, RP2350) and a few framework module changes, I can now compile and link BlinkPlus
with Astrobe v9.3 for Cortex-M0, and execute it on the RP2350. Of course, the program can also be compiled and linked to run on the RP2040, using the new modules directory tree. The compiler and linker just need to find the correct MCU-specific modules (see the config files).
For clarity, the RP2350’s Cortex-M33 cores execute Cortex-M0+ code, and any M33 features that require compiler support, eg. for the FPU, will only be used with a compiler for the M33.
Being able to run Cortex-M0 (and Cortex-M4) code allows some first exploration of the RP2350 with the currently available tools, as well as porting parts of the library modules.
On the RP2350, the program starts to execute in secure, privileged mode, and I don’t see any reason why Cortex-M0+ code as created using Astrobe for Cortex-M0 (or other compilers) could not make use of many of the RP2350’s advanced features and peripheral devices.
Astrobe Versions Tested
In addition to Astrobe for Cortex-M0, I have used the following Astrobe products to generate code for the RP2350 (latest versions):
- Astrobe for RP2040 Starter Edition
- Astrobe for RP2040 Professional Edition
- Astrobe for Cortex-M4, both with the “Thumb Code” checkbox on and off
Note that this is a very limited test – only one simple program, all executing in the Secure realm, including the exception handling of the run-time error reporting. For example, module RuntimeErrors
will require substantial extensions and adaptations for the RP2350.
New Transmogrifier
The RP2350 requires a different .bin
to .uf2
transmogrifier. You find a first quick hack in the tools
directory, for now creatively named abin2uf22.py
.
Bottom Line
There is a first set of modules and tools to get Cortex-M0/M4 code running on the RP2350. Alas, there’s no (updated) documentation yet, and apart from this change note this website does not even mention the RP2350.1 Please refer to the modules and config files if you want to use what’s available now, or shoot me an e-mail for questions.
Further Reading
- RP2350 datasheet
- ARMv8-M architecture
- Definitive Guide to ARM Cortex-M23 and Cortex-M33 Processors, by Joseph Yiu
-
For personal reasons I only had a week or so to get to this state of progress since the previous change note in August. ↩︎