https://toitlang.org/ logo
Command line firmware size calculation
# help
a
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)?
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
f
I think
toit tool firmware extract --image ...
should give you a file with the correct size.
a
that looks correct
Copy code
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