summaryrefslogtreecommitdiff
path: root/ports/stm32/powerctrl.c
diff options
context:
space:
mode:
authorAngus Gratton <gus@projectgus.com>2022-06-07 17:44:21 +1000
committerDamien George <damien@micropython.org>2022-06-28 10:25:08 +1000
commit2c015375d1e795b4c1a996e50b27234e07f3f638 (patch)
treee4124a7b4f97dbfad50e995910ffdf846365552f /ports/stm32/powerctrl.c
parent5b66d086090e16134e58db62160257d7ca109be4 (diff)
stm32: Use a separate symbol name for the bootloader state pointer.
Prerequisite for enabling Link Time Optimisation. The _bl_state address is the same as _estack, but _estack is referred to as a uint32_t elsewhere in the code. LTO doesn't like it when the same symbol has two different types. Signed-off-by: Angus Gratton <gus@projectgus.com>
Diffstat (limited to 'ports/stm32/powerctrl.c')
-rw-r--r--ports/stm32/powerctrl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/powerctrl.c b/ports/stm32/powerctrl.c
index 3b4a2d86e..f3f1837ec 100644
--- a/ports/stm32/powerctrl.c
+++ b/ports/stm32/powerctrl.c
@@ -78,7 +78,7 @@
// Location in RAM of bootloader state (just after the top of the stack).
// STM32H7 has ECC and writes to RAM must be 64-bit so they are fully committed
// to actual SRAM before a system reset occurs.
-#define BL_STATE_PTR ((uint64_t *)&_estack)
+#define BL_STATE_PTR ((uint64_t *)&_bl_state)
#define BL_STATE_KEY (0x5a5)
#define BL_STATE_KEY_MASK (0xfff)
#define BL_STATE_KEY_SHIFT (32)
@@ -87,7 +87,7 @@
#define BL_STATE_GET_REG(s) ((s) & 0xffffffff)
#define BL_STATE_GET_KEY(s) (((s) >> BL_STATE_KEY_SHIFT) & BL_STATE_KEY_MASK)
#define BL_STATE_GET_ADDR(s) (((s) >> BL_STATE_KEY_SHIFT) & ~BL_STATE_KEY_MASK)
-extern uint64_t _estack[];
+extern uint64_t _bl_state[];
#endif
static inline void powerctrl_disable_hsi_if_unused(void) {