I want to update some data stored in UICR CUSTOMER area on an nrf52832.
Code to do this works fine, as long as the areas are already erased (0xFFFFFFFF).
However, if they have already had a value written, and I want to update it, I understand I need to erase the UICR area first as its flash.
My process is
- copy out the non-CUSTOMER registers, to save them
- enable erase in the NVMC CONFIG
- ask the NVMC to erase by writing 1 to ERASEUICR register
- enable writing
- write back the saved registers
- go back to read mode
(and then do my usual writing code)
However, as soon as I start the process the MCU hangs (no logs, no crash, just hung).
Here is my code : I never see any of the logs probably coz the UART doesn't manage to get the bytes out!
Any ideas what I'm doing wrong?
Thanks