From 8693a23ff5ffa8247193dba4d1a05c8a0b694438 Mon Sep 17 00:00:00 2001 From: "Spence Konde (aka Dr. Azzy)" Date: Sun, 13 Oct 2019 03:34:36 -0400 Subject: [PATCH] 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) https://github.com/SpenceKonde/megaTinyCore/issues/95 --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index f079040c..8cce6304 100644 --- a/platform.txt +++ b/platform.txt @@ -79,7 +79,7 @@ recipe.output.save_file={build.project_name}.{build.variant}.hex ## Compute size recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* +recipe.size.regex=^(?:\.text|\.data|\.rodata|\.bootloader)\s+([0-9]+).* recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*