Skip to content

boards.txt can not control "build.warn_data_percentage" setting #1036

Open
@PaulStoffregen

Description

@PaulStoffregen

Normally boards.txt can control settings as needed for each individual board. However, "build.warn_data_percentage" can not be customized. The default 75 setting is appropriate for small memory boards, but causes needless (and alarming) warnings on boards with much more memory.

To reproduce this problem, add this line to boards.txt:

uno.build.warn_data_percentage=80

Then compile this sketch for Arduino/Genuino Uno

volatile char bigbuf[1536];
void setup() {
  bigbuf[0] = 0;
}
void loop() {
}

The 80% setting line will be ignored and Arduino will print the warning "Low memory available, stability problems may occur."

The problem seems to be on line 236 in Compiler.java:
https://github.com/arduino/Arduino/blob/master/arduino-core/src/cc/arduino/Compiler.java#L236

    commandLine.addArgument("-prefs=build.warn_data_percentage=" + PreferencesData.get("build.warn_data_percentage"));

This gives the builder an explicit override, causing it to ignore any setting that may be present in boards.txt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions