In my application I want to know if a DFU was executed successful and I'm using GPREGRET2 for it.
If a DFU as successful I'm writing GPREGRET2:
nrf_power_gpregret2_set(0x02);
In my application I read this register but get strange results, reading it the first time returns 0xE1, reading it a few moments later it returns the expected value 0x02;
See the Logging:
0015 [3] Application -> [00:00:02.368] T:xxxxxHsm Check DFU 1
0016 [0] DiagnosticMgr -> [00:00:02.368] T:xxxxxHsm Intern Check DFU
0017 [0] DiagnosticMgr -> [00:00:02.369] T:xxxxxHsm GPREGRET2 e1
0023 [3] Application -> [00:00:02.372] T:xxxxxHsm End Check DFU 1
0024 [3] Application -> [00:00:02.548] T:xxxxxHsm Check DFU 2
0025 [0] DiagnosticMgr -> [00:00:02.549] T:xxxxxHsm Intern Check DFU
0026 [0] DiagnosticMgr -> [00:00:02.549] T:xxxxxHsm GPREGRET2 2
0027 [0] DiagnosticMgr -> [00:00:02.550] T:xxxxxHsm !!!!!!!!!DFU performed CORRECTLY !!!!!!!!!!!!
0033 [3] Application -> [00:00:02.553] T:xxxxxHsm End Check DFU 2
Between the first read at 02.369 and the second read on 02.549, there are only 180ms.
Function the read the GPREGRET2 is:
sd_power_gpregret_get(1, ®_val)
I want to read this RGPREGRET2 as soon as possible after the start up of the application as I want to base some initialization decisions on it.
I'm using nRF52833 with Softdevice S113 for BLE
Thanks