• AVR Freaks

Store Struct in AUX Flash on ds33EPMU806

Author
Dareon
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2011/07/28 13:53:58
  • Location: 0
  • Status: offline
2020/01/20 13:54:22 (permalink)
0

Store Struct in AUX Flash on ds33EPMU806

How do I get an initialized structure to get placed into the auxflash program memory? I am wanting to place some constants into memory that are accessable to both the bootloader and application.
 
typedef struct{
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
}CONFIG;
 
CONFIG CustomDeviceConfig __attribute__ ( ( code, address( 0x7FC000 ) ) ) =
            {   0x9876,       
                0x5432,
                0x01,
                0x1234
            }; 
 
From my gld linker file.
MEMORY
{
  data  (a!xr)   : ORIGIN = 0x1000,        LENGTH = 0x7000
  reset          : ORIGIN = 0x0,           LENGTH = 0x4
  ivt            : ORIGIN = 0x4,           LENGTH = 0x1FC
 
  app_ivt        : ORIGIN = 0x2000,        LENGTH = 0x200
 
#ifdef __BOOTLOADER
  program (xr)   : ORIGIN = 0x400,         LENGTH = 0x1C00
#else
  program (xr)   : ORIGIN = 0x2200,         LENGTH = 0x289FC
#endif

  auxflash (xr)  : ORIGIN = 0x7FC000,      LENGTH = 0x3FFA
  FGS            : ORIGIN = 0xF80004,      LENGTH = 0x2
  FOSCSEL        : ORIGIN = 0xF80006,      LENGTH = 0x2
  FOSC           : ORIGIN = 0xF80008,      LENGTH = 0x2
  FWDT           : ORIGIN = 0xF8000A,      LENGTH = 0x2
  FPOR           : ORIGIN = 0xF8000C,      LENGTH = 0x2
  FICD           : ORIGIN = 0xF8000E,      LENGTH = 0x2
  FAS            : ORIGIN = 0xF80010,      LENGTH = 0x2
  FUID0          : ORIGIN = 0xF80012,      LENGTH = 0x2
}
 
This is not placing these constants in the proper place in flash.  Any idea what I need to do to get this to work correctly?
post edited by Dareon - 2020/01/20 13:57:16
#1

0 Replies Related Threads

    Jump to:
    © 2020 APG vNext Commercial Version 4.5