nrf-hal
nrf-hal copied to clipboard
Add support for partial flash erase
Partial erase is a feature that allows to reduce time CPU is halted when using NVMC. It works by dividing page erase operation into multiple operations, in-between each operation CPU is resumed allowing interrupt handling.
Erasing a single page takes 85 ms on nRF52840, during write CPU can't handle interrupts, this may result, e.g. in broken USB, especially if erase happens during enumeration.
This code has been tested on nRF52840 by zeroing page, erasing it and checking whether all bits are back to 1.