Well maybe using the XIP region where flash is actually mapped would be good idea.
Not sure how writing to flash works when XIP is enabled, it will probably block executing from flash in similar way as on nrf5x where any execution is halted when erasing/writing.
How does it work on ESP32/8266? It is exactly the same problem there.
reading directly from flash works fine
writing needs disabling of irq
If somebody has a better solution, you are welcome
mask = getIrqMask();
flash_range_program(FLASH_TARGET_OFFSET, addr + i * FLASH_PAGE_SIZE, FLASH_PAGE_SIZE);
© Espruino, powered by microcosm.
Report a problem