Use other core auto-parking on FlashStorage

This commit is contained in:
Jakub Hlusička 2026-01-02 17:27:49 +01:00
parent 67c2a8f2b6
commit 8468421817

View file

@ -198,7 +198,15 @@ async fn main(_spawner: Spawner) {
}; };
// Initialize the flash // 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 flash = async_flash_wrapper(flash);
let sck = Output::new(peripherals.GPIO36, Level::High, OutputConfig::default()); let sck = Output::new(peripherals.GPIO36, Level::High, OutputConfig::default());