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

Nrf52840-DK reset button doesnt work?

Hi can somebody help why nrf52840 doesnt be reseted when you press SW5(if boot/reset)? I have alredy with tried with few examples flashed on nrf52840 and in Segger IDE set CONFIG_GPIO_AS_PINRESET  as in datasheet says "When using SEGGER Embedded Studio, go to Project > Edit Options > Code > Preprocessor > Preprocessor Definitions and add the CONFIG_GPIO_AS_PINRESET variable. "

NRF52840-DK PCA10056 1.0.0 2018.46 683391762

nrf5_sdk_15.3.0

  • Hi

    Can you please check out this link, which deals with a similar issue. It might be that your reset pin is set as P0.21 for some reason.

    Best regards,

    Simon

  • #if defined (CONFIG_GPIO_AS_PINRESET)
    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))){
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_UICR->PSELRESET[0] = 18;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_UICR->PSELRESET[1] = 18;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    NVIC_SystemReset();
    }
    #endif
    it seems to me that is set pin p0.18.

    i dont have this function in entire solution nrf_drv_usbd_errata_type_52840_fp1.

    my sdk is nrf5 15.3

    this is in system_nrf52840.c

    EDIT: 

    Im not 100 percent sure but i think that started after i have tried with nrf connect programmer app to flash nrf52840-dk with hex generated in SES. Maybe some settings is erased with Erase ALL command in nrf connect programmer? I have tried flashing from SES too but now that problem with reset button happens all the time?

  • PROBLEM SOLVED: 

    It seems that nrf connect app -> programmer app have some problem. I have tried multiple time to flash nrf52840-DK  with SES and NRF connect  programmer app with the same hex and problem will still always occur. 

    I have now in SES in target tab first on connect j-link and then in SES in target tab on erase all and flash with the same hex used before and now reset work.

  • Hi

    Glad you were able to solve the problem. Is the project you tried flashing a custom output .hex file from SES, or one of the SDK examples "premade" .hex files? If it's a custom application, it's likely that the .hex file you tried flashing in nRFConnect didn't include the SoftDevice. If the SoftDevice is used by your application, you'll have to add the SoftDevice .hex that can be found in ...\nRF5_SDK_15.3.0_59ac345\components\softdevice\s140\hex 

    Best regards,

    Simon

  • probally is that but for now everything works.

Related