Hi,all.I have a question that NRF_POWER->GPREGRET will change it's value in what conditions?Power on or App reset?Can someone help me ?
Hi,all.I have a question that NRF_POWER->GPREGRET will change it's value in what conditions?Power on or App reset?Can someone help me ?
Hi wuvo.leo,
This values should be persistent until IC is powered down completely by Voltage (BOR). However it should be very easy to test for you by printing out values of both NRF_POWER->GPREGRET
and NRF_POWER->RESETREAS
registers in boot sequence after different reset situations.
Cheers Jan
Hi
This is stated in nRF51 Series Reference Manual v3.0, section 12.1.19. You can see there that retained registers are reset on pin reset, watchdog reset, brownout reset and power on reset. The GPREGRET is a retained register.
Thanks a lot! i use it to enter bootloader mode.my program enter bootloader mode automatically after power on every time.Have any idea to avoid this?
For an unmodified bootloader: If the application that you have uploaded is not valid for any reason, then the device will start up in bootloader mode after power on reset. The bootloader will also read the GPREGRET register in order to know if a peer device (central device) wants to initiate bootloader mode or not. Perhaps you need to debug the bootloader code in order to know what is going on in your case.
What development board are you using. If you are using the nRF51822/nRF51422 development kit together with the nRF6310 motherboard, then you need to connect the configured bootloader pin P0.7 to the button, otherwise it will be detected as pushed and you will always start up in bootloader mode.
There is also a bootloader intro blog available here
Thanks,Stefan!i'll test it,if have any question,i will post again.