From 846842181727c950d749dd9ff457d59fe0d6e23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hlusi=C4=8Dka?= Date: Fri, 2 Jan 2026 17:27:49 +0100 Subject: [PATCH] Use other core auto-parking on `FlashStorage` --- firmware2/src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/firmware2/src/main.rs b/firmware2/src/main.rs index 28443aa..56dabd7 100644 --- a/firmware2/src/main.rs +++ b/firmware2/src/main.rs @@ -198,7 +198,15 @@ async fn main(_spawner: Spawner) { }; // Initialize the flash - let flash = FlashStorage::new(peripherals.FLASH); + let flash = FlashStorage::new(peripherals.FLASH) + // Flash memory may not be written to while another core is executing from it. + // By default, `FlashStorage` is configured to abort the operation and log an error message. + // However, it can also be configured to auto-park the other core, such that writing to + // flash succeeds. + // Alternatively, XiP from PSRAM could be used along with the `multicore_ignore` strategy, + // to avoid having to park the other core, which could result in better performance. + // Invalid configuration would then present itself as freezing/UB. + .multicore_auto_park(); let flash = async_flash_wrapper(flash); let sck = Output::new(peripherals.GPIO36, Level::High, OutputConfig::default());