Hi guys,
I am trying to create a Dual bank DFU bootloader (BL) program for nRF51822 which will be able to update the SoftDevice and bootloader no matter if the "Enable SoftDevice protection" is checked in the first place. I am not sure how it is possible.
First, I manage to disable the SoftDevice Protection by a code as below in the BL:
NRF_UICR->CLENR0 = 0xFFFFFFFF;
Sort of strange things happen when I try to switch between SD110+BL110 and SD120+BL120. The DFU process does not fail (and the Firmware Ids are good) but when I load my application, which is based on SD110, it does not work! If I uncheck the "Enable SoftDevice Protection" in nRFgo studio by JLink in the first place, the application works well even after several SD+BL switches.
In another test, I load the SD120 and BL120 (with NRF_UICR->CLENR0 = 0xFFFFFFFF line and Enable SD protection unchecked) and switch on SD110+BL110 via DFU and try to load the Application Jlink which gives me an error like "the device has two different CLeR0 values written. Try programming a new SoftDevice first".
I can see that the Firmware in Region 0 is a correct one as S110_nRF51822_7.1.0 (Id: 0x005a) but I have to erase all and program the SD110 to make things working.
Thanks,
Ehsan