Skip to content

Commit f7b24ec

Browse files
Fix flash size regex
This regex would only look at the .text section, but the .data section (initialization values for global variables) also takes up space in flash. The regex is changed to match both sections. arduino-builder will then add together the values and show the sum to the user (this summing seems to have been supported at least since the introduction of arduino-builder, see: arduino/arduino-builder@0802e27 The regex format is copied from the AVR core, which already did the same (though AVR also includes a .bootloader section, which is not relevant here it seems, any bootloader is included in .text). This also copies the start-of-line ^ anchor to the regex, making the matching more accurate.
1 parent f852a08 commit f7b24ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_ou
117117

118118
## Compute size
119119
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
120-
recipe.size.regex=\.text\s+([0-9]+).*
120+
recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).*
121121

122122
# Upload/Debug tools
123123
# ------------------

0 commit comments

Comments
 (0)