tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

program too large for this chip; not getting -size full dump

Open scottfeldman opened this issue 9 months ago • 2 comments

With v0.36.0, my program will not fit in flash, which is no problem, except I can't see what to trim because the -size full dump doesn't get printed.

$ tinygo build -target wioterminal -stack-size 8kb -size full runner.go
exit status 1: program too large for this chip (flash overflowed by 9052 bytes)
	optimization guide: https://tinygo.org/docs/guides/optimizing-binaries/

Here it would be nice to see the -size full output.

scottfeldman avatar Mar 04 '25 09:03 scottfeldman

Perhaps you can try to build for a target with more flash such as pico and get the output that way.

deadprogram avatar Mar 07 '25 02:03 deadprogram

Yeah, this is difficult. We need to have a linked binary to be able to print the size. But the binary is too big to be linked. So the size can't be printed.

A dirty workaround would be to modify the 0x00080000 here to be larger to produce a binary: https://github.com/tinygo-org/tinygo/blob/3869f76887feef6c444308e7e1531b7cac1bbd10/targets/atsamd51.ld#L4 But don't forget to change it back afterwards! The linked binary won't be correct with this change.

aykevl avatar Oct 01 '25 10:10 aykevl