This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RESET PIN flag of RESETREAS sets after power cycle

Hi,



I'm currently developing software on nrf52832. Unfortunately, I can't use the SDK for different reasons.

I'm currently looking at the RESETREAS register. If I correctly understand the datasheet, I should have the RESETREAS register with all bits to 0 if the module restarts after a power-cycle. However, in my case, I got the RESET PIN flag that is always set (RESETREAS=0x00000001) after such event.

In other situations, as for example after a reset from my code, I correctly have SREQ flag that is set (RESETREAS=0x00000100).

At boot, I read the RESETREAS register. Then I clear it to avoid having problems at next boot (NRF_POWER->RESETREAS = 0xFFFFFFFF;).


Do you have any idea why I always get the RESET PIN flag after a simple power off-power on ?



Thanks in advance for your answer,



Best regards,



Florent

Parents Reply Children
  • Hi Einar,

    Thank you for your answer. 

    • Can you upload a code snippet that reproduces it on your side? Here is what I'm doing:

    uint32_t reset_reason;
    // Read the RESETREAS register
    reset_reason = NRF_POWER->RESETREAS;
    // Clear the flag
    NRF_POWER->RESETREAS = 0xFFFFFFFF;

    After a power cycle, reset_reason = 1. After a soft reset from my code for instance, reset_reason = 4.

    • Do you see it occurring on multiple nRF52832 devices?

    Yes I've tried on 3 devices and it happened on the 3.

    • Is pin reset enabled for the device (PSELRESET in UICR)?

    I think so but maybe I'm doing it in a wrong way. Here is how I do:

    if (((NRF_UICR->PSELRESET[0] & UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos)) ||
      ((NRF_UICR->PSELRESET[1] & UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos))){
    	/** Configure the NVMC for write mode */
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    		// Do nothing.
    	}
    
    	/** Activate the reset pin */
    	NRF_UICR->PSELRESET[0] = 21;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    		// Do nothing.
    	}
    	NRF_UICR->PSELRESET[1] = 21;
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    		// Do nothing.
    	}
    
    	/** Desactivate write mode for the NVMC (let it in read mode) */
    	NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    	/** Wait until config is done */
    	while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    		// Do nothing.
    	}
    }

    • Do you see the same if it is not? 

    I'm not sure to understand what you mean sorry. 

    Thanks in advance for your answer,

    Best regards,

    Florent

  • Hi,

    Are you using custom HW? Could it be that for some reason the reset pin is asserted for some reason during power-up?

    My last question should not have been a separate point, so It became unclear. What I wander is if you see the same behaviour if you don't have pin reset enabled (to disable it you have to erase UICR and do a power cycle)?

  • Thank you for your answer Einar.

    Indeed, it's custom HW. Bu you are right. I will test on an DK board. I have no DK board with me today. I will therefore try tomorrow and see the behavior with this HW.

    Concerning the reset pin, as you say, I will also test with the reset pin not enabled. 

    I will inform you about the results tomorrow (after the test on the DK board). 

    Best regards,

    Florent

Related