From: sjlongland Date: Mon, 28 Sep 2015 10:43:36 +0000 (+0000) Subject: stm32_flash: Add BKPSRAM section. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=018d47d8bebdcfa86f1cbb4247702d68eddfeaa1;p=freetel-svn-tracking.git stm32_flash: Add BKPSRAM section. 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 --- diff --git a/codec2-dev/stm32/stm32_flash.ld b/codec2-dev/stm32/stm32_flash.ld index 7ecd81a9..44f47929 100644 --- a/codec2-dev/stm32/stm32_flash.ld +++ b/codec2-dev/stm32/stm32_flash.ld @@ -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 : {