aboutsummaryrefslogtreecommitdiff
path: root/stmhal/storage.c
diff options
context:
space:
mode:
authorTobias Badertscher2016-03-22 17:49:39 +0100
committerDamien George2016-04-21 13:03:38 +0100
commit067fb2da14a687534a0b4ba801a7c001f6a0a32b (patch)
treefc195c06a2ebfc8a56a178638d5097afce016833 /stmhal/storage.c
parentdda1a41205ce67c3e5f3e680f9a4359fc3f80f96 (diff)
stmhal: L4: Modify flash.c and storage.c to support L4 MCU.
The way to lookup the flash sector now uses a much simpler table for all MCUs.
Diffstat (limited to 'stmhal/storage.c')
-rw-r--r--stmhal/storage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stmhal/storage.c b/stmhal/storage.c
index dd1e3e285..0c91fa084 100644
--- a/stmhal/storage.c
+++ b/stmhal/storage.c
@@ -84,6 +84,14 @@ STATIC byte flash_cache_mem[0x4000] __attribute__((aligned(4))); // 16k
#define FLASH_MEM_SEG1_START_ADDR (0x08008000) // sector 1
#define FLASH_MEM_SEG1_NUM_BLOCKS (192) // sectors 1,2,3: 32k+32k+32=96k
+#elif defined(STM32L476xx)
+
+// The STM32L476 doesn't have CCRAM, so we use the 32K SRAM2 for this.
+#define CACHE_MEM_START_ADDR (0x10000000) // SRAM2 data RAM, 32k
+#define FLASH_SECTOR_SIZE_MAX (0x00800) // 2k max
+#define FLASH_MEM_SEG1_START_ADDR (0x08000800) // sector 1
+#define FLASH_MEM_SEG1_NUM_BLOCKS (252) // 1 Block=512 Bytes Reserve 126 kBytes
+
#else
#error "no storage support for this MCU"
#endif