How to download firmware via USB to RP Pico or how to download firmware via uf2 file

How to download firmware via USB to RP Pico or how to download firmware via uf2 file.

1 Like

Hello @Temurumaru ,

Welcome to the Embeetle forum.

To download firmware to a Raspberry Pi Pico (RP2040), you need to put it into Mass Storage mode. This is done with the following procedure:

  • Press&hold the BOOTSEL button on the Pico
  • While holding BOOTSEL, plug the USB cable from the Pico into your computer
  • The Pico should appear as a Mass Storage Device in your file explorer
  • To upload your .uf2 file, simply copy&paste it into the Pico’s directory
  • When you successfully copy&pasted the .uf2 file, the Pico will be automatically ejected from the USB port and the firmware transferred successfully.

I hope I understood your question correctly. If not, please let me know if we can help you further.
For more details on how to flash firmware to a Raspberry Pi Pico using Embeetle, please check our website here: Embeetle IDE

Regards,
Matic

1 Like

I just wanted to say that there is no way I can compile a project to uf2 file on Embeetle IDE

1 Like

Currently we compile to .bin and .elf files only, we do not do any extra conversions. The files are located in your Pico project’s build directory after you have done a successful build:
image
.uf2 files are created from .elf files using the elf2uf2 tool.
To get a .uf2 file you would need to install the official Raspberry Pi Pico SDK to get their elf2uf2 tool to convert the .elf file into a .uf2 file, or compile the tool yourself with the code from here:

It is trivial to add the conversion to the build procedure (the elf2uf2 tool needs to be on your path):

  • Open the project’s config/makefile file
  • Go to line 565 and insert <\tab>elf2uf2 $(ELF_FILE) application.uf2, it should look like this:
    image
  • The press the Build button, wait for it to build and voila, there is the .uf2 file:
    image

I highly recommend you use Linux for this, as the elf2uf2 tool was made for use on an actual Raspberry Pi. I cannot guarantee it will work on Windows.

Hope this helps. If you need any other help, please let me know.

P.S.:
I just tried the elf2uf2 tool from the github link above and it doesn’t seem to work on Windows! It creates a .uf2 file, but the file is very small in size and doesn’t work on the Pico! Probably the elf2uf2 tool from the official Raspberry Pi SDK work, but I haven’t tried it yet, as the SDK is Linux only I think, which would mean having to use Windows-Subsystem-for-Linux (WSL).
This is irrelevant, as I was notified of a different elf2uf2 version by Lars Pötter.

P.P.S.:
I’m now in going to try to get the elf2uf2 to compile on Windows with the help of the Github repo’s owner, Lars Pötter (JustAnother1).

Regards
Matic

3 Likes

Thank you very much! It worked for me. I wish there were such kind and active people on all forums! :slight_smile:

2 Likes

Hi @Temurumaru

Lars Pötter has updated the elf2uf2 tool and now you can even download a precompiled version for Windows here: Releases · JustAnother1/elf2uf2 · GitHub
Thank you @Lars :tada:

For help with the tool usage use:

elf2uf2 --help

Example of converting a .elf file for the RP2040:

elf2uf2 -f 0xe48bff56 -p 256 -i application.elf

Thank you @Temurumaru also for the feedback and testing đź‘Ť
1 Like

Thank you for that :slight_smile:

1 Like