[DEV] RP2040 support

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
Ludeks
Posts: 9
Joined: Sun Mar 13, 2016 2:52 pm
Has thanked: 3 times

[DEV] RP2040 support

Post by Ludeks »

Raspberry Pi Pico has been just released with Dual-core Arm Cortex M0+ processor at 133 MHz and some interesting features like inter-core FIFOs and Hardware Spinlocks.

From hobbyist perspective, I think it would be very interesting to get ChibiOS running on this device.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NOTES] Multi Core support

Post by Giovanni »

Hi,

Interesting, I didn't know they made a MCU. Yes, it could be the right platform for a basic SMP OS. Making an HAL looks simple too.

What is needed to get started?

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NOTES] Multi Core support

Post by Giovanni »

I ordered a couple of those but delivery is expected next month.

After a first look I don't see problems, the MCU appears to be very simple.

Giovanni
Ludeks
Posts: 9
Joined: Sun Mar 13, 2016 2:52 pm
Has thanked: 3 times

Re: [NOTES] Multi Core support

Post by Ludeks »

I have also ordered a piece, I'm very excited. :)
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NOTES] Multi Core support

Post by Giovanni »

I just received mine, much earlier than expected.

Now next step is: how to load code in those?

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: [NOTES] Multi Core support

Post by steved »

Just happened across this link, which might be a bit quicker than threading through all the woffle on the Pico Forum. (And the documentation - almost too much!)
Ludeks
Posts: 9
Joined: Sun Mar 13, 2016 2:52 pm
Has thanked: 3 times

[DEV] RP2040 Support

Post by Ludeks »

Giovanni wrote:Now next step is: how to load code in those?


You should be able to connect the device as a USB Mass Storage and just drop UF2 firmware onto it.

All documentations can be found on this site: https://www.raspberrypi.org/documentati ... g-started/
- RP2040 datasheet
- Pico datasheet
- Getting Started guides with the board and SDK

This is the source of the ROM bootloader: https://github.com/raspberrypi/pico-bootrom
I think it might be helpful to understand the boot sequence.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [NOTES] Multi Core support

Post by Giovanni »

Is it possible to use an stlink with this board? if not, what should I get as debugger?

Just loading the code is fine but for an OS port debug capability is needed.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: [NOTES] Multi Core support

Post by steved »

Maybe: https://www.raspberrypi.org/forums/view ... 4&t=299705

Certainly the device supports 2-wire SWD, which IIRC is the recommended debug approach for "serious" work.

You may know the answer for the ST-Link; if that doesn't work, I'd imagine something like a Segger, but probably not the cheap clones.

Note: "kilograham" is one of the RPi engineers who did a lot of of the Pico software. It's well worth asking questions in the RPi forums; as well as the RPi engineers there are a good number of knowledgeable and capable people there. You're likely to get good answers to the sort of question you're likely to ask.
Ludeks
Posts: 9
Joined: Sun Mar 13, 2016 2:52 pm
Has thanked: 3 times

Re: [NOTES] Multi Core support

Post by Ludeks »

Debugging with SWD should be definitely possible and even encouraged to upload the firmware.

The official docs mention plugging the SWD port from the Pico into UART on another Pico or Raspberry Pi computer.

Also, a custom OpenOCD build might be needed.

See section 5. of https://datasheets.raspberrypi.org/pico ... h-pico.pdf
https://github.com/raspberrypi/openocd
Post Reply