Closed DrMarkEy closed 3 years ago
This cannot be fixed by Arduino or megaTinyCore. It would be nice if the avrgcc deveopers could improve their error messaged under these conditions, though, as this is an awful way to report the error to the user
On small-flash parts (I know it happens with 4k parts and 2k parts, unsure if 8k parts can do it, my prediction is that they can't), it can give you this error, instead of a more useful description of the compile problem. The actual problem is that your sketch is too big to fit in the parts' flash - but it isn't able to get far enough in the process to give you that error, because it's dying in the middleof the process. Often if you scroll up you'll see an error that something exceeded the size of text.
You can prove this also by switching to a larger flash chips the wthe same pincount, and and compiling; youwill notice that the compiled size is larger than the amount of flash in the part you were compiling for
Thanks for the fast reply. Unfortunately I think there must be something more to it: Often when I compile my code for the attiny814 it runs without an error and tells me that about 80% flash memory is in use. Then I only edit one line of code (something like add or remove a Serial.print) and it won't compile any more, giving me this error. If I keep on making edits at other places it will work again at random. Meanwhile the size of the compiled code does only change by a few bytes at most...
Same here. I'm at 72% of flash, and still I get this popping up seemingly randomly for an Tiny824. Compiled for the 1624, memory usage is 6,126B, well under the 8k capacity of the 824. OTOH, including the printf library by specifying a non-default setting sometimes fixes it, sometimes unfixes it. So, it may have something to do with memory size, but it's not obvious to me what the relationship is.
Sometimes when I try to compile my program, I get an error like:
After some searching I found, this seems to be caused by the -mshort-calls compiler option, as explained in: https://stackoverflow.com/questions/8188849/avr-linker-error-relocation-truncated-to-fit
Unfortunately I have no idea how to fix this in the arduino IDE. Is this something that can be fixed in megatinycore or is it an arduino issue?