From fe52fcdb1a3babc38ecbc8e2a463d7f98fab49e0 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 24 Apr 2021 19:09:33 +0200 Subject: [PATCH] stm32: Define FLASH_BASE and PERIPH_BASE for all families FLASH_BASE was already defined for some and PERIPH_BASE for all but one, but this makes these available for all families. Note that the value is identical for all familes (I doublechecked the more exotic ones such STM32H7), but it is still useful to have these defines to make code more readable and so that libopencm3 users can write portable code without having to check that these are identical on all STM32 families. --- include/libopencm3/stm32/f2/memorymap.h | 1 + include/libopencm3/stm32/f3/memorymap.h | 1 + include/libopencm3/stm32/f4/memorymap.h | 1 + include/libopencm3/stm32/f7/memorymap.h | 1 + include/libopencm3/stm32/g0/memorymap.h | 1 + include/libopencm3/stm32/g4/memorymap.h | 2 ++ include/libopencm3/stm32/h7/memorymap.h | 1 + include/libopencm3/stm32/l0/memorymap.h | 1 + include/libopencm3/stm32/l1/memorymap.h | 1 + include/libopencm3/stm32/l4/memorymap.h | 1 + 10 files changed, 11 insertions(+) diff --git a/include/libopencm3/stm32/f2/memorymap.h b/include/libopencm3/stm32/f2/memorymap.h index 4f47a32f..6cb0ca93 100644 --- a/include/libopencm3/stm32/f2/memorymap.h +++ b/include/libopencm3/stm32/f2/memorymap.h @@ -25,6 +25,7 @@ /* --- STM32F20x specific peripheral definitions --------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000) #define PERIPH_BASE_APB2 (PERIPH_BASE + 0x10000) diff --git a/include/libopencm3/stm32/f3/memorymap.h b/include/libopencm3/stm32/f3/memorymap.h index 877cd8dc..b9708272 100644 --- a/include/libopencm3/stm32/f3/memorymap.h +++ b/include/libopencm3/stm32/f3/memorymap.h @@ -27,6 +27,7 @@ /* --- STM32F3 specific peripheral definitions ----------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000) #define PERIPH_BASE_APB2 (PERIPH_BASE + 0x10000) diff --git a/include/libopencm3/stm32/f4/memorymap.h b/include/libopencm3/stm32/f4/memorymap.h index 6b96ac01..be78f548 100644 --- a/include/libopencm3/stm32/f4/memorymap.h +++ b/include/libopencm3/stm32/f4/memorymap.h @@ -25,6 +25,7 @@ /* --- STM32F4 specific peripheral definitions ----------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000) #define PERIPH_BASE_APB2 (PERIPH_BASE + 0x10000) diff --git a/include/libopencm3/stm32/f7/memorymap.h b/include/libopencm3/stm32/f7/memorymap.h index b7bd1be4..47663bae 100644 --- a/include/libopencm3/stm32/f7/memorymap.h +++ b/include/libopencm3/stm32/f7/memorymap.h @@ -23,6 +23,7 @@ /* --- STM32F7 specific peripheral definitions ----------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000) #define PERIPH_BASE_APB2 (PERIPH_BASE + 0x10000) diff --git a/include/libopencm3/stm32/g0/memorymap.h b/include/libopencm3/stm32/g0/memorymap.h index ebe342b7..1bf07989 100644 --- a/include/libopencm3/stm32/g0/memorymap.h +++ b/include/libopencm3/stm32/g0/memorymap.h @@ -20,6 +20,7 @@ #include +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define IOPORT_BASE (0x50000000U) #define INFO_BASE (0x1fff7500U) diff --git a/include/libopencm3/stm32/g4/memorymap.h b/include/libopencm3/stm32/g4/memorymap.h index 56a16617..7da6e578 100644 --- a/include/libopencm3/stm32/g4/memorymap.h +++ b/include/libopencm3/stm32/g4/memorymap.h @@ -20,6 +20,8 @@ #include +#define FLASH_BASE (0x08000000U) +#define PERIPH_BASE (0x40000000U) #define INFO_BASE (0x1fff0000U) #define PERIPH_BASE_APB1 (0x40000000U) #define PERIPH_BASE_APB2 (0x40010000U) diff --git a/include/libopencm3/stm32/h7/memorymap.h b/include/libopencm3/stm32/h7/memorymap.h index 875b28e3..112b3bca 100644 --- a/include/libopencm3/stm32/h7/memorymap.h +++ b/include/libopencm3/stm32/h7/memorymap.h @@ -23,6 +23,7 @@ /* --- STM32H7 specific peripheral definitions ----------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE 0x08000000U #define PERIPH_BASE 0x40000000U #define PERIPH_BASE_APB1 0x40000000U #define PERIPH_BASE_APB2 0x40010000U diff --git a/include/libopencm3/stm32/l0/memorymap.h b/include/libopencm3/stm32/l0/memorymap.h index e384c5c2..1bde26eb 100644 --- a/include/libopencm3/stm32/l0/memorymap.h +++ b/include/libopencm3/stm32/l0/memorymap.h @@ -23,6 +23,7 @@ /* --- STM32 specific peripheral definitions ------------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define IOPORT_BASE (0x50000000U) #define INFO_BASE (0x1ff80000U) diff --git a/include/libopencm3/stm32/l1/memorymap.h b/include/libopencm3/stm32/l1/memorymap.h index 88974e2b..15a0cc91 100644 --- a/include/libopencm3/stm32/l1/memorymap.h +++ b/include/libopencm3/stm32/l1/memorymap.h @@ -26,6 +26,7 @@ /* --- STM32 specific peripheral definitions ------------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define INFO_BASE (0x1ff00000U) #define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000) diff --git a/include/libopencm3/stm32/l4/memorymap.h b/include/libopencm3/stm32/l4/memorymap.h index 5cd17ffd..c2ac47e1 100644 --- a/include/libopencm3/stm32/l4/memorymap.h +++ b/include/libopencm3/stm32/l4/memorymap.h @@ -23,6 +23,7 @@ /* --- STM32 specific peripheral definitions ------------------------------- */ /* Memory map for all busses */ +#define FLASH_BASE (0x08000000U) #define PERIPH_BASE (0x40000000U) #define FMC1_BANK_BASE (0x60000000U) #define FMC3_BANK_BASE (0x80000000U)