From 278b050a03b5dd6c13a4bbccc2bc0c8d8ac3d03e Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 11 Oct 2020 03:04:08 -0700 Subject: [PATCH] [skip changelog] Document available memory build properties upload.maximum_data_size and upload.maximum_size are properties used by the build system to fail compilation when memory usage exceeds a threshold and to calculate the relative memory usage for display in the console. --- docs/platform-specification.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/platform-specification.md b/docs/platform-specification.md index bfcc5bad728..a80f8146573 100644 --- a/docs/platform-specification.md +++ b/docs/platform-specification.md @@ -270,6 +270,19 @@ For AVR we have: recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* +Two properties can be used to define the total available memory: + +- `{upload.maximum_size}`: available program storage space +- `{upload.maximum_data_size}`: available dynamic memory for global variables + +If the binary sketch size exceeds the value of these properties, the compilation process fails. + +This information is displayed in the console output after compiling a sketch, along with the relative memory usage +value: + + Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes. + Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. + #### Recipes to export compiled binary When you do a **Sketch > Export compiled Binary** in the Arduino IDE, the compiled binary is copied from the build