Rp2040 current.uf2

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Rp2040 current.uf2

Post by LivingSynthesis »

I love the uf2 bootloaders on all my adafruit products like my trinket m0! Im playing with the rp2040 boards now and noticed they work similarly, however when they boot in bootsel mode, there is no current.uf2 present on the drive. Is there a way to extract the current.uf2 from rp2040 boards like was possible with atsamd21 boards, or can you only upload new uf2s to them? I looked everywhere but couldn't find any information about this, any advice would be appreciated! I have read and understand how to upload new uf2s but my question is how to find the current.uf2 of these boards, thanks in advance!
Last edited by LivingSynthesis on Tue Jun 28, 2022 9:21 pm, edited 1 time in total.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Rp2040 current.uf2

Post by dastels »

Why do you need the CURRENT.UF2? All that's needed from the bootloader is to load a UF2 into flash.

Dave

User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Re: Rp2040 current.uf2

Post by LivingSynthesis »

I would like to be able to save changes made by users on one device, and take the uf2 with those changes and upload them to another device. It's incredibly useful for my trinket m0s

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Rp2040 current.uf2

Post by dastels »

Does that actually work?

Assuming it does, what changes do users make that is reflected by the UF2 that is in flash? Why not just get the UF2 they loaded and load it on the others?

Dave

User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Re: Rp2040 current.uf2

Post by LivingSynthesis »

Im using flash to store changes made by the user while the device is powered on. This has a limited number of write cycles of course but it's enough to last about 20 years of regular saving. After making a custom save file users will want to send them to each other or back them up before overwriting their own. If they use the original uf2 they loaded they will lose their own customizations and be unable to share theirs with others!

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Rp2040 current.uf2

Post by dastels »

You are doing this now? And it works? Or this is what you have in mind as a solution?

Why not write files to the flash filesystem? That would be the approach I'd take.

Dave

User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Re: Rp2040 current.uf2

Post by LivingSynthesis »

Yeah I'm doing it right now with trinket m0's and it works great. Various users trade and backup their uf2s all the time and they really enjoy it! Saving is not the issue, it's trading those saves between devices and backing them up. Can you explain how your solution can help me with this? I'm a little confused to how that's different from what I'm already doing.

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Rp2040 current.uf2

Post by dastels »

Well, it's a file you can do anything with, depending on the format you save it in. I'm baffled that your approach works! But if it does, and does what you need... huzzah!

But I see what you mean about the RP2040 boards not exposing CURRENT.UF2. None of my 2040 boards have it. It does use a different bootloader than other Adafruit UF2 capable boards.

Dave

User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Re: Rp2040 current.uf2

Post by LivingSynthesis »

Yeah I assumed it was due to the bootloader, and I somehow doubt it's a simple matter to just add that functionality to the rp2040! I'm gonna try to learn more about the flash filesystem, hopefully I can use it to figure out a similar situation with the rp2040!

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Rp2040 current.uf2

Post by dastels »

One advantage of saving to and reading from files is that it's portable and will work on anything that will run CircuitPython (regardless of whether you use CircuitPython or C++ (using tinyUSB).

Dave

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Rp2040 current.uf2

Post by adafruit2 »

yeah Raspi foundation did not implement reading - just writing! you could look at the command line tools to read/write the flash maybe theres a flash-dump command?

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Rp2040 current.uf2

Post by neradoc »

Hi,
You can save the content of the flash into a UF2 file with picotool. Which you might have to compile.
The board must be in bootloader mode.

Code: Select all

picotool save --all my_full_board.uf2
More info: https://github.com/raspberrypi/picotool#save

It's a useful way to deploy code to multiple identical RP2040 boards too.
Note that the binary might be specific to the flash chip used due to the flash init sequence I think.

User avatar
LivingSynthesis
 
Posts: 31
Joined: Thu Nov 16, 2017 1:22 am

Re: Rp2040 current.uf2

Post by LivingSynthesis »

Wow that picotool looks like pretty much exactly what I'd need. I wonder how hard it would be for non-technical users to set it up on their computers or if it could be made into like an exe or something.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”