stm32_flash: Add BKPSRAM section.
authorsjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 28 Sep 2015 10:43:36 +0000 (10:43 +0000)
committersjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 28 Sep 2015 10:43:36 +0000 (10:43 +0000)
This is taken from the datasheet.  We can place variables in there by
declaring them in the C code like this:

/*!
 * User preferences
 */
static struct prefs_t {
    /*! Serial number */
    uint64_t serial;
    /*! Menu frequency */
    uint16_t menu_freq;
    /*! Menu speed */
    uint8_t menu_speed;
    /*! Menu volume (attenuation) */
    uint8_t menu_vol;
    /*! Default operating mode */
    uint8_t op_mode;
} prefs __attribute__((section(".bkpsram")));

git-svn-id: https://svn.code.sf.net/p/freetel/code@2408 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/stm32/stm32_flash.ld

index 7ecd81a9ce2bce98444083e5322288932efaeb02..44f4792940c5c0a1b43061e79865393fa374bd83 100644 (file)
@@ -16,6 +16,8 @@ MEMORY
   EEPROM (rx)     : ORIGIN = 0x08004000, LENGTH = 48K
   /* The rest of flash is used for program data */
   FLASH (rx)      : ORIGIN = 0x08010000, LENGTH = 960K
+  /* Backup memory area */
+  BKPSRAM (rwx)   : ORIGIN = 0x40024000, LENGTH = 4K
   /* Memory area */
   RAM (rwx)       : ORIGIN = 0x20000000, LENGTH = 128K
   /* Core Coupled Memory */
@@ -41,6 +43,12 @@ SECTIONS
     . = ALIGN(4);
   } >EEPROM = 0xff
 
+  .bkpsram :
+  {
+    . = ALIGN(4);
+    KEEP(*(.bkpsram))
+    . = ALIGN(4);
+  } > BKPSRAM
 
   .text :
   {