Uninitialized variables are included in the BSS section.
First question : Will they stay there when they are assigned?
Second question/problem : I want to load this section in an external SDRAM. Variables are properly located in the memory map, but filled with strange values, and I can't store any other number into. Do you have an idea about this problem?
/* Memory Map */
MEMORY{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x0017FFE0
FLASH1 (RX) : origin=0x00180000 length=0x00180000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0003EB00
SDRAM (RW) : origin=0x80000000 length=0x00800000
}
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS{
.intvecs : {} > VECTORS
.text : {} > FLASH0 | FLASH1
.const : {} > FLASH0 | FLASH1
.cinit : {} > FLASH0 | FLASH1
.pinit : {} > FLASH0 | FLASH1
.bss : {} > SDRAM
.data : {} > RAM
.sysmem : {} > RAM
}