Skip to content

Commit 8693a23

Browse files
authored
Correct size output for const variables
avr-size reports const variables in .rodata. recipe.size.regex did not check .rodata when totaling up flash usage. This would result in the reported size of the sketch not including variables that were declared const; it was possible to make a sketch that did not fit in the flash, but where this wasn't detected until it got to avrdude during the upload process, and avrdude dutifully reported that it was trying to write to addresses that were out of range. See the big discussion over here when I encountered this in megaTinyCore (and @MCUdude discovered that this happened on the official megaavr boards too) SpenceKonde/megaTinyCore#95
1 parent b367b67 commit 8693a23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ recipe.output.save_file={build.project_name}.{build.variant}.hex
7979

8080
## Compute size
8181
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
82-
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
82+
recipe.size.regex=^(?:\.text|\.data|\.rodata|\.bootloader)\s+([0-9]+).*
8383
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
8484
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
8585

0 commit comments

Comments
 (0)