guild icon
Toit
#Command line firmware size calculation
Thread channel in help
addshore
addshore 09/26/2025 08:11 AM
Every now and again I make firmware that is too big
Error: Firmware is too big to fit in designated partition (1844624 > 1835008) for example
Is there a command line tool / way that I can get the size of an envelope file? without having to try and flash it?
I thought perhaps jag toit tool firmware -e apps.envelope show | yq '.Containers | .[] as $item ireduce (0; . + $item.Size)', but that returns only 396868 (far below the limit)?
addshore
addshore 09/26/2025 08:17 AM
I see the error is from https://github.com/toitlang/toit/blob/ffc3b1be5c5a82107576fff783a5667b3f6b81ca/tools/firmware.toit#L952
But dont really see any other commands for printing / getting the size
Program your microcontrollers in a fast and robust high-level language. - toitlang/toit
floitsch
floitsch 09/26/2025 08:33 AM
I think toit tool firmware extract --image ... should give you a file with the correct size.
addshore
addshore 09/26/2025 09:08 AM
that looks correct

jag toit tool firmware -e apps.envelope extract -o /tmp/foo ls -la /tmp | grep foo -rw-r--r-- 1 adam adam 1844624 Sep 26 10:07 foo
4 messages in total