Quantcast
Viewing all articles
Browse latest Browse all 4897

Other RP2040 boards • Re: New board can't program flash.

I'm working on a program to combine two UF2 files. Everybody merges the BIN files converts to ELF and then outputs the UF2 of the combined stuff. I think writing the UF2 combiner should be easier than learning how to do that.... So far I've been proven wrong: it didnt' work first try. I'll publish once I get it working.
I don't believe 'everybody' uses that merge technique, loading multiple '.uf2' files to different addresses seems the preferred practice to me, but merging two or more '.uf2' files is fairly easy.

The main thing to remember is that each 512 byte block contains the total number of blocks in the file and an incrementing number for each block so you need to know the sizes of everything you are merging or will be creating before emitting the output file.

I can't recall if non-contiguous blocks are supported or gaps should be filled with 0xFF, or if blocks need to be padded to be multiple of 4KB, but it's easy enough to fill in gaps and do the padding so a '.uf2' is definitely compatible with any tool or RP2040 bootloader.

Most hosts have GB of memory so it's usually possible to load up to 16 MB of image and then sequentially output blocks which makes block numbering on output rather trivial.

Statistics: Posted by hippy — Tue Feb 13, 2024 1:25 pm



Viewing all articles
Browse latest Browse all 4897

Trending Articles