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

Parents
  • 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?

Reply
  • #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?

Children
No Data
Related