From 2cf8aae3fc832ff8a04773c3cc01a509590860c9 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 5 Jul 2026 12:12:12 +0200 Subject: [PATCH] Add sanity check to ensure core1 in async flash commits. Signed-off-by: Pol Henarejos --- src/fs/low_flash.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fs/low_flash.c b/src/fs/low_flash.c index dc4ee62..0a074c5 100644 --- a/src/fs/low_flash.c +++ b/src/fs/low_flash.c @@ -266,6 +266,13 @@ static bool low_flash_available(void) { } bool low_flash_commit_sync(uint32_t timeout_ms) { +#if defined(PICO_PLATFORM) + // Core 0 owns low_flash_task(). Waiting for it from core 0 would prevent + // the queued flash operation from ever being serviced. + if (get_core_num() != 1) { + return false; + } +#endif low_flash_commit(); uint32_t start = board_millis();