From 3587d8e80853051b84da25e8d9abc3422bc6f57f Mon Sep 17 00:00:00 2001 From: Asensio Lorenzo Sempere Date: Mon, 18 Apr 2022 02:39:09 -0500 Subject: [PATCH] stm32/storage: Add support for internal storage on Cortex-M0 MCUs. This implements self-triggering of the Flash NVIC interrupt on Cortex-M0 devices, which allows enabling internal storage on those MCUs. Signed-off-by: Asensio Lorenzo Sempere --- ports/stm32/storage.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/stm32/storage.c b/ports/stm32/storage.c index fcc6d51b3d..a043570f1b 100644 --- a/ports/stm32/storage.c +++ b/ports/stm32/storage.c @@ -83,7 +83,11 @@ uint32_t storage_get_block_count(void) { static void storage_systick_callback(uint32_t ticks_ms) { if (STORAGE_IDLE_TICK(ticks_ms)) { // Trigger a FLASH IRQ to execute at a lower priority + #if __CORTEX_M == 0 + NVIC_SetPendingIRQ(FLASH_IRQn); + #else NVIC->STIR = FLASH_IRQn; + #endif } }