massimi.federico.001

Large array declaration

Discussion created by massimi.federico.001 on Mar 1, 2017
Latest reply on Mar 23, 2017 by Chris T

Good morning,
  I have a problem with the declaration of an array.

if I declare these two arrays before the main I have no compilation/linking problem

uint16_t buffer [48000];
uint16_t buffer2 [48000];

but if I try to declare only one array of 49000 elements

uint16_t buffer [49000];

I get this error

Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss).
Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32l476xx.o(STACK).
Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss).
Error: L6406E: No space in execution regions with .ANY selector matching stm32l4xx_hal.o(.data).
Error: L6406E: No space in execution regions with .ANY selector matching stm32l4xx_hal_msp.o(.data).
Error: L6406E: No space in execution regions with .ANY selector matching system_stm32l4xx.o(.data).
Error: L6406E: No space in execution regions with .ANY selector matching stdout.o(.data).
Error: L6407E: Sections of aggregate size 0x18468 bytes could not fit into .ANY selector(s).

The error seems to be an issue of space of memory, but if I have space to declare two arrays of 48000 elements, Why I can not declare just one of 49000 items?

 

The MCU is a STM32L476

 

Thanks in advance
Federico.

Outcomes