![]() |
Forum Index : Microcontroller and PC projects : Easy .uf2 file creation?
Author | Message | ||||
carlschneider Senior Member ![]() Joined: 04/08/2023 Location: South AfricaPosts: 158 |
Hi I notice that some code is being delivered in a .uf2 file as a means of installing the complete package with all supporting files through a simple drag and drop. XModem in MMEdit is padding transferred files to 128 byte boundaries when transferring in MMCC, which is a problem for some files; such as a javascript file I noticed recently. TFTP on Windows is a CLI and takes some driving to achieve binary file transfers. Is there a simple way to wrap all the required files in a .uf2 delivery file to ensure correct delivery of the payload that could be adversely affected by padding? Guidance would be appreciated Cheers Carl Retirement is tough on Hobbies without a day job |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
XMODEM pads the file whichever program you use to initiate the XMODEM transfer. That's XMODEM - not MMEdit. If you have installed TFTP and connect to your webmite via Telnet/TCPIP instead of USB, MMEdit's file manager will use TFTP for the transfers instead of XMODEM. No need to get your hands dirty at the command-line. One day I might white my own TFTP client and incorporate it into MMEdit. If you don't use MMEdit but do use Windows, create a batch file with this content, changing the IP address to suit echo %1 echo %~nx1 tftp -i 10.1.0.232 PUT %1 %~nx1 pause and place it on your desktop. You can then drag and drop files onto the desktop icon and transfer to your webmite that way. Jim VK7JH MMedit |
||||
carlschneider Senior Member ![]() Joined: 04/08/2023 Location: South AfricaPosts: 158 |
Thanks Jim and noted. Hopefully that will assist Fred when he does the update. Cheers Carl Retirement is tough on Hobbies without a day job |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3270 |
You need to load all the files onto a Pico first (which is what you are trying to avoid) but for others who want to create a single uf2 file containing everything, this is how I do it: You need picotools: https://github.com/raspberrypi/picotool. I had to install a driver using Zadig https://zadig.akeo.ie/ (When it loads just click on InstallDriver even though Driver: will show NONE) Creating an Image of the Pico Flash is easy (using Windows): 1. Load all the files onto a Pico and set any options 2. Plug the Pico in while holding down BOOTSEL switch. Same as loading new firmware 3. Run a command window where pocotool.exe is located 4. Run this command: picotool save -a filename.uf2 Geoff Geoff Graham - http://geoffg.net |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 3998 |
Same command should work on Linux (That command line is basically a Linux one on Windows.) Linux normally has the required driver(s) already. John Edited 2023-09-16 23:33 by JohnS |
||||
carlschneider Senior Member ![]() Joined: 04/08/2023 Location: South AfricaPosts: 158 |
Thanks Peter, much appreciated. I note that all files, program memory, flash slots and options need to be setup before the uf2 is created. I’m guessing there are a whole lot of other things being copied to the uf2 that I have not even considered. It really makes a binary level copy of everything that’s on the Pico and effectively wipes everything that was there before when it is loaded through the BOOTSEL route. I was wondering if there is a way of embedding some files that could then be written by the bas program to the A: drive? Something like Define Font and Csubs that store data that can then be read and written to a file on the A: drive. That way it doesn’t have to be a uf2 file and the bas program creates its own running environment on first launch at the cost of some bloat. Thanks for the comments John - I found a brew that loaded the Picotool on the MacBook and have successfully read the Pico contents and saved to a uf2 file. Cheers Carl Retirement is tough on Hobbies without a day job |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |