From abfbcf18f58cbff3a6ec486c302f3bf525b6a988 Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Wed, 15 Apr 2026 13:27:32 -0700 Subject: [PATCH 1/2] stm32/boards/OPENMV_N6: Add .ram_function_data attr to _boot_mem. --- ports/stm32/boards/OPENMV_N6/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/boards/OPENMV_N6/board.c b/ports/stm32/boards/OPENMV_N6/board.c index d4b2fa1a164cd..e00b22edc4006 100644 --- a/ports/stm32/boards/OPENMV_N6/board.c +++ b/ports/stm32/boards/OPENMV_N6/board.c @@ -97,7 +97,7 @@ void board_enter_bootloader(unsigned int n_args, const void *args) { NVIC_SystemReset(); } -static char _boot_mem[128] __attribute__((aligned(1024))); +static char _boot_mem[128] __attribute__((aligned(1024), section(".ram_function_data"))); __attribute__((naked, noreturn, section(".ram_function"))) void ram_reset(void) { // NVIC_SystemReset doesn't get inlined here. From 870143f7cc30779988cfec49c7665a7fa6cb9a9f Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Thu, 16 Apr 2026 11:20:47 -0700 Subject: [PATCH 2/2] stm32: Disable TCMFLEX Power retention. --- ports/stm32/boards/OPENMV_N6/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32/boards/OPENMV_N6/board.c b/ports/stm32/boards/OPENMV_N6/board.c index e00b22edc4006..ca300de955815 100644 --- a/ports/stm32/boards/OPENMV_N6/board.c +++ b/ports/stm32/boards/OPENMV_N6/board.c @@ -119,7 +119,7 @@ void board_early_init(void) { void board_enter_standby(void) { HAL_PWREx_EnableTCMRetention(); - HAL_PWREx_EnableTCMFLXRetention(); + HAL_PWREx_DisableTCMFLXRetention(); uint32_t *boot_mem = (uint32_t *)_boot_mem; boot_mem[0] = (uint32_t)(_boot_mem + sizeof(_boot_mem));