-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Tools: Switch from elf2uf2 to modern picotool #21269
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
Conversation
I have tested this working properly on a Pi Pico 1 now. I am not too confident in my understanding of the RIOT packages makefile system so I am happy to hear feedback 😄 |
Wouldn't it be easier to use the precompiled binaries of picotool instead of compiling it on demand: https://github.com/raspberrypi/pico-sdk-tools/releases ? |
Given the way elf2uf2 worked and looking into other packages + the documentation I would have assumed that the preference is to avoid binaries when possible |
I gave this a try now and unfortunately there seems to be an issue with the CMake configuration of the picotool that others have run into as well: https://www.reddit.com/r/embedded/comments/1els7zl/armnoneeabig_not_working/ Build log:
This seems to be an issue with MBedTLS using the wrong compiler, but I couldn't really pinpoint the issue and how to solve it. I wondered if it would be possible to check for |
I can confirm that this also happened for me but after tinkering a bit with the Makefile it didn't happen again, I'll investigate if I can reproduce it again, thank you for testing it, I thought this was a local one-off issue |
Furthermore it would be good to add For example: - echo "[INFO] compiling picotool from source now"
+ @echo "[INFO] compiling picotool from source now" |
Thank you for the review, I will adjust the PR based on your suggestions as soon as I can |
Was able to verify it flashing and building for the raspberry pi pico 2 |
The patch for the The red warning message is also not shown because of the indentations in the
|
Done :) |
Thanks @AnnsAnns for doing this! I've just tried this out right now and I noted two things:
|
I will test whether I can simply remove mbedtls and flash to pico/pico2 once I am in the office (unless somebody else tries it before me 😄), will let you know |
But |
Discussion if mbedtls can be remove, bugs in makefiles
Hum, not for me. |
That is expected though, isn't it? AFAIK |
|
So I wont lie, I'm a bit confused, is distclean being buggy something I need to fix in my Makefiles or is this something that was accidentally found out while reviewing this PR? 😅 |
Mikolai likes to find unrelated bugs and derail PRs 🤪 @mguetschow this is actually a build system bug: Lines 26 to 28 in ce273ac
I added an
@AnnsAnns you can squash the fixup directly, don't worry about the other bug :D |
Hooray |
I retested the |
I just tested it without mbedtls on the Pi Pico 1 and I can confirm that it still works. One other minor thing I noticed was that the uf2 file doesn't get executed until you replug the device. As far as I'm aware this should be a simple flag that I need to enable. |
Picotool now start the program automatically and mbedtls is excluded. Verified on Pi Pico 1 😄 |
You can squash the fixups. By the way: May I interest you in That makes your life a bit easier with fixups. |
Replace elf2uf2 usage with picotool, fix compilation when arm g++ is installed, adjust documentation to new workflow, picotool udev warning (thanks to crasbe)
Will try it in the future, ty :) Also squashed 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Merging as Mikolai stated we can move on! |
Contribution description
The Pi Pico 2 requires a more modern version of elf2uf2 called picotool, in a first effort to get the Raspberry Pi Pico 2 to be compatible with Riot I thus needed to update it.
While this PR is intended to allow me to work on the Pi Pico 2, picotool also offers advantages for the Pico 1 such as easier device detection, loading/flashing and the ability to easily verify the integrity of a file after loading it onto the device. I have incorporated these advantages into the existing workflow so hopefully the flashing process should have become easier for everyone 😄
Testing procedure
I verified it working with examples using the pi pico 1, the expected outcome is that the user should not experience any differences while flashing (aside from the tool being different)
Issues/PRs references