I'm running ChibiOS on a STM32F429VI which has 2048 kB Flash and 256 kB RAM. What I'm trying to do, is to allocate a static array like
Code: Select all
static uint16_t Buffer[X] = {0};
I curious what's the maximum static array size can be. For an array size up to X = 64800, compiling works fine. For a larger array e.g. X = 64900 i get following error:
rules.ld:359 cannot move location counter backwards (from 200300a0 to 20030000)
collect2.exe: error: ld returned 1 exit status
According to the address shown above, the static array is allocated from the SRAM, corresponding to the Reference Manual RM0090 (section 2.3.1 page 68). As I'm allocating an uint_16t array, the array should have a size of 2 x 64900 = 129.8 kB, which shouldn't be too large for the RAM.
To be hornest, I don't kow which part of my program is stored in the Flash and which in the RAM. I assume, the main part is stored in the Flash, as it is non-volatile.
Further, I'm using ChibiStudio and for me it's not clear how large my code is, as I only get the following lines when compiling is finished
text data bss dec hex filename
60732 456 196604 257792 3ef00 build/TEST.elf
Is it the size of the .hex file (in the build folder)?
Perhaps someone can clarify things for me .
BR Skadi