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

NRF_UICR->CUSTOMER read/write on 52832

Hello,
I'm trying to port my code (working in production) from 52811 to 52832.

I have several crashes on a piece of code at the start of my application that check the NRF_UICR, and based on the value does something then erases it.

When I say crash, it restarts the application, without entering app_error_fault_handler 

// Check first two bytes of NRF_UICR->CUSTOMER
if ( NRF_UICR->CUSTOMER[0] != 0x0 || NRF_UICR->CUSTOMER[1] != 0x0 ) {
    
    // Read NRF_UICR->CUSTOMER[i], i from 0 to 8
    (...)
    
    //Erase first two bytes of NRF_UICR->CUSTOMER
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_UICR->CUSTOMER[0] = 0x0;
    NRF_UICR->CUSTOMER[1] = 0x0;
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
}
 

What could be different between 52811 and 52832 on this matter ?

Best regards,
Quentin

  • Is there any way you can create an example I can run on an nRF52-DK here? 

    Can you provide the chip laser markings that is printed on top of the nRF52832 IC?

    I am not sure what nRF52 hardware you are using here? Is it a nRF52-DK or your own board?

    Kenneth

  • This is my own board. This is a board that have been produced with a 52811, and on which the 52811 has been later replaced by a 52832 (drop-in replacement)

  • Do you see the same with CONFIG_NFCT_PINS_AS_GPIOS and/or CONFIG_GPIO_AS_PINRESET not defined? 

    I just notice both are handled in system_nrf52.c, and if you have any reset, then they may trigger a soft reset. So you would then not see the actual first reset since the actual first reset is then "masked" by the soft reset caused by either of these defines.

    Kenneth

  • Hello Kenneth,

    I have the same result with both CONFIG_NFCT_PINS_AS_GPIOS and CONFIG_GPIO_AS_PINRESET undefined.

    I have stabilized my port, and I'm now in a state where everything works fine when commenting out the erasing of the first two bytes of NRF_UICR->CUSTOMER

    When uncommenting, project crashes every few seconds (even by itself, when I'm not using any i/o)

    I have added some logs :

    NRF_LOG_INFO("Erasing UICR start");
    NRF_LOG_FLUSH();
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    NRF_LOG_INFO("Erasing UICR 1");
    NRF_LOG_FLUSH();
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_UICR->CUSTOMER[0] = 0x0;
    NRF_UICR->CUSTOMER[1] = 0x0;
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_LOG_INFO("Erasing UICR end");
    NRF_LOG_FLUSH();

    Output :

    00> <info> app: APP START
    00> <info> app: Erasing UICR start
    00> <info> app: Reset_reason: 0x00000004.
    00> <info> app: Reset_reason resetted: 0x00000000.
    00> <info> app: APP START
    00> <info> app: Erasing UICR start
    00> <info> app: Reset_reason: 0x00000004.
    00> <info> app: Reset_reason resetted: 0x00000000.
    
    (...)

  • Please start working on a simplified project I can unzip to a folder you specify in an nRF5 SDK you specify. Do you have access to an nRF52 DK you can use for comparison here?

    If you have "crashes" I assume you mean asserts?

    Please also answer my question: "Can you provide the chip laser markings that is printed on top of the nRF52832 IC?"

    Do you see the same with debugger not connected?

    Is the power supply steady here?

    Kenneth

Related