Arduino ATmega4809 code size exceeded without warning/error

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In case anyone is using the Arduino environment for compiling code for the ATmega4809, be aware that code can be generated that does not fit into the ATmega4809 Flash memory without any warnings or errors!

 

It appears that the "avr-size" tool is incorrectly determining the size of the program storage space.

 

Arduino Environment
----------------------
Arduino 1.8.8 on a Windows XP machine
Board: "Arduino Nano Every"
Registers emulation: "None (ATMEGA4809)"

 

Example Output:
"....\\Local Settings\\Application Data\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-size" -A "....\\LOCALS~1\\Temp\\arduino_build_140636/Test.ino.elf"
Sketch uses 48880 bytes (99%) of program storage space. Maximum is 49152 bytes.
Global variables use 290 bytes (4%) of dynamic memory, leaving 5854 bytes for local variables. Maximum is 6144 bytes.

 

The actual code size is: 49165 bytes (0xC00D)

 

End of hex file:
:10BFFA0080000013001400280024F400C0D40100BB
:04C00A00FF01010031
:00000001FF

 

If the compiled Sketch uses more than 48874 bytes (99%), code, this problem occurs.