Replies: 9 comments 11 replies
-
I've got some Pico boards on order too. 😄 They should be here on Monday. My goal is to extensively support the Pico in pyocd. There is one complication for quickly supporting the RP2040. Section 2.3.4 in the datasheet describes the DAP structure. It has three DPs, one for each M0+ core and a "Rescue DP", connected via multidrop SWD. The Rescue DP is not connected to any APs and its The use of multidrop SWD is a problem only because pyOCD doesn't support it yet since there hasn't been a need for it. (It has never even been on the roadmap.) Given that, we should start with single-core RP2040 and flash programming support, and then work on multidrop support. Normally supporting devices with a boot ROM can be tricky because vendors like to disable debug while the ROM is executing startup (often for part configuration such as phantoming, i.e., setting the available memory sizes and/or features based on configured part number). But in this case the ROM is open source and debug is probably never disabled. We can use the FlashAlgo project to quickly build the flash algo using the ROM APIs. (One of the problems with multidrop SWD is that there is no way to automatically discover available DPs. You have to know the target ID in advance. This should be possible to work around for the RP2040 though.) cc @mbrossard |
Beta Was this translation helpful? Give feedback.
-
Someone has already written an FLM-compatible flash algo in Rust: https://github.com/rp-rs/flash-algo That's one piece of the work already done. 😄 |
Beta Was this translation helpful? Give feedback.
-
First connect: the Pico's ROM bootloader mass storage volume was mounted, connecting pyocd via Log:
|
Beta Was this translation helpful? Give feedback.
-
Created the branch where I'll be adding RP2040 support: https://github.com/flit/pyOCD/tree/feature/rp2040 I haven't gotten the flash algo to build yet. It requires a nightly version of cargo, and I'm having trouble getting that and the |
Beta Was this translation helpful? Give feedback.
-
Some progress has been made on my flit:feature/rp2040 branch. (PRs against this branch are welcome.) The To generate the target selection sequence, an |
Beta Was this translation helpful? Give feedback.
-
The RP2040 target on my flit:feature/rp2040 branch is working now for core 0. Flash programming seems to work fine. There are a few things I'd like to clean up before merging. (The CI servers are also still down due to the blackouts in Austin from the winter storms.) |
Beta Was this translation helpful? Give feedback.
-
Great! |
Beta Was this translation helpful? Give feedback.
-
@newbrain's picoprobe support (Thanks again! 🥇) has been merged into my feature/rp2040 branch, since it supports the newly added In the initial PR with Pico support, I'm going to add two separate targets for the RP2040, for the two cores. So you'll be able to debug either core, but not both simultaneously. I'm also planning some architectural changes to cleanly support multi-drop SWD and multiple DPs. |
Beta Was this translation helpful? Give feedback.
-
Update: RP2040 support (#1083) has been merged in. There are three targets:
The plan is to release a new pyocd version 0.30.0 this weekend. |
Beta Was this translation helpful? Give feedback.
-
I'm about to create PR for a ThreadX/Azure RTOS plugin (probably today or tomorrow), but, in the meantime, I've ordered a couple of the new Pico boards.
If there's any interest, I can start some work to add the RP2040 MCU to the built in targets, and the Pico to board id list (possibly with its new blinky binary).
The target is has a bootrom, and possibly a 2nd stage bootloader to setup the external flash, flash algorithms are in rom too, so that should not be a terribly complicated task.
I can probably get inspiration from the RPi openocd fork.
Not having received them yet, this is only preliminary work (i.e.: I cannot test until I have the board).
Beta Was this translation helpful? Give feedback.
All reactions