Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to streamline the elf to uf2 converting for rpi pico? #3283

Open
oldoldman opened this issue Aug 25, 2024 · 1 comment
Open

how to streamline the elf to uf2 converting for rpi pico? #3283

oldoldman opened this issue Aug 25, 2024 · 1 comment

Comments

@oldoldman
Copy link

Hi guys,
I have comipled the examples/rp successfully and got the ELF binaries. To run the examples on raspberry pico(w) board, they must be converted to UF2 file format. For now , I have to do it manually by runing picotool. Is there any way to integrate this step into the build process? Many thank!

@1-rafael-1
Copy link
Contributor

In very general terms You have a few options:

  • eliminate picotool, by using elf2uf2-rs and do the loading to the board manually. You can basicall call elf2uf2-rs on the full path to your elf (which usually has no .elf file ending, and then You will find a new uf2-file next to the elf file and You can flash that manually by copying it over to the Pico W in bootsel mode.
  • step that up with more convenience, but still using uf2: You can read up on that on another teams page here, for a good introduction: https://github.com/rp-rs/rp-hal?tab=readme-ov-file. The readme gives a good idea on what to do and they have a link to their template where You can have at their .cargo/config.toml, You basically use the concept of a runner and when you do a cargo run or cargo run --release the config determines what to do to actually perform the command.
  • For my taste the most convenient option is to use a debug probe though. It not only flashes the binary to the Pico W but also allows You to inspect what your firmware is doing, mostly by info messages but to some extend also even by allowing actual debugging. You also do not need to fiddle with the bootsel button for that. You can aslo read up on that in the above links, and also you can have a look at the required config here: https://github.com/embassy-rs/embassy/blob/main/examples/rp/.cargo/config.toml right from the Embassy rp examples. On top of that You would need to do cargo install probe-rs and of course get and connect a probe. I am using the debug probe from Raspberry Pi, which is not expensive and works very well for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants