TinyCircuits / TinyCircuits-Thumby-Code-Editor

https://code.thumby.us/
GNU General Public License v3.0
30 stars 20 forks source link

Reduce filesystem overhead of UF2 #98

Open ace-dent opened 1 year ago

ace-dent commented 1 year ago

From https://github.com/TinyCircuits/TinyCircuits-Thumby-Code-Editor/pull/73#issuecomment-1402119063

Investigate how bundling an FS with picotool might be optimized, to reduce the overall size of the UF2 for flashing.


Current process noted here:

  1. Load a Thumby with everything that is needed for shipping (MicroPython, games, libs, etc.).
  2. Use picotool (https://github.com/raspberrypi/picotool) to clone a UF2 from the Thumby. I use Linux and this command: sudo ./picotool save -r 0x10000000 0x10200000 ThumbyFirmware.uf2.

This specifies an address range of 2,097,152 bytes / 2048 KiB / 2 MiB. Using picotool info -a will give the actual end address - so it may be possible to avoid copying empty 256 byte blocks?... but this may be required to keep the filesystem intact?


See also documentation on the format: https://github.com/microsoft/uf2

ace-dent commented 1 year ago

Note the deliberate low efficiency of the UF2 format:

It may be possible to configure the RP2040 / flash storage to use a different page size for improved packing.