Pattern for Writing to UICR while Soft Device Enabled

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?

Related