AnsweredAssumed Answered

Issue placing constants in flash

Question asked by james.norman on Nov 21, 2016
Latest reply on Nov 22, 2016 by james.norman
I'm following the post on [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/How%20to%20allocate%20variable%20in%20Flash%20to%20desired%20address&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=7799]ST Forum, to place constants in flash of an STM32F107.  I have this in .c file:
__attribute__((__section__(".eeprom"))) const uint8_t userConfig[16384];

I have this in .ld file:
MEMORY
{
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 64K
FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 256K - 16K
DATA (rx)      : ORIGIN = 0x803C000, LENGTH = 16K
}
 
.eeprom :
  {
    . = ALIGN(4);
         *(.eeprom)
    . = ALIGN(4);
  } > DATA

But in the .map file, it doesn't show it placing variable:
eeprom         0x0803c000        0x0
                0x0803c000                . = ALIGN (0x4)
 *(.eeprom)
                0x0803c000                . = ALIGN (0x4)
 I would expect to see non-zero size and name of const here.  Please help.

Outcomes