I have a case where a module that can perform bit clears in the UICR needs to execute while a Soft Device is present and enabled.
I am aware that any direct flash access to the UICR while the Soft Device is enabled will result in a hard fault.
I can temporarily disable the Soft Device via softdevice_handler_sd_disable() and later re-enable via softdevice_enable() but the approach seems heavy handed. Is there a cleaner way to approach this problem?
In SDK V12.2.0 I found that there are new functions available softdevice_handler_suspend() and softdevice_handler_resume() but it does not appear that this will prevent hard fault when writing to flash.
I noted in Question 39317 that there was a possibility of allowing sd_flash_write() to access UICR region. Is there any update on if that capability is available?
Unfortunately, the functionality for writing to UICR while the softdevice is enabled will not be implemented.
Is this the case in SDK 13.0.0 as well? I would like to use the UICR customer registers, but am running into the hardfault problem. If I reset the MCU, the data is written (not trying to erase, just write the erased page with data). Still, I would like a way to write without having to reset via hard fault.
Instead of writing to UICR, you can write to flash, using for example FDS.