-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Tools: Switch from elf2uf2 to modern picotool #21269
base: master
Are you sure you want to change the base?
Conversation
picotool: start elf2uf2 migration picotool: Replace elf2uf2 usage with picotool picotool: Fix incorrect filename for flash utility picotool: fix compilation when arm g++ is installed picotool: picotool-ify flash process picotool: Adjust documentation to new workflow
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
|
Tested, is able to flash to rpi pico 1 and 2 |
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.
These are the last change requests, I promise! 😅
Thank you for your thorough review 😄 |
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.
I have to break my promise 😭
Thanks, the double colons makefile syntax definitely feels absolutely wrong, the more I learn about Makefiles the less I understand Makefiles 😆 |
all: $(CURDIR)/picotool | ||
|
||
clean:: | ||
rm picotool |
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.
rm picotool | |
rm picotool |
Speaking of Makefile oddities, this has to be a tabulator, spaces don't work.
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.
rm picotool | |
rm -f picotool |
It would be also good to add the -f
option again so that rm
won't complain if there is no picotool
binary.
I wanted to be "more gentle" with the rm
, but that was wrong apparently. Sorry for the wrong suggestion (again).
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