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());