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

DFU

I have a DFU issue; SDK nRF5_SDK_13.0.0_04a0bfd

The system reboots on the DFUTAG after having completed the application upload.

I have the following errors :
:DEBUG:Error code - sd_softdevice_vector_table_base_set: 0x00000000
:DEBUG:Before SOFTDEVICE_HANDLER_APPSH_INIT
:DEBUG:After SOFTDEVICE_HANDLER_APPSH_INIT
:INFO:Error code - sd_ble_cfg_set: 0x00000000

Parents
  • Hi Bjorn,

    I added the following code in nrf_dfu.c 

    __WEAK bool nrf_dfu_enter_check(void)
    {
        if (nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0)
        {
        	NRF_LOG_DEBUG("******* BOOTLOADER_BUTTON == 0 ************** \n");
        	return true;
        }
    
        if(NRF_POWER->GPREGRET == BOOTLOADER_DFU_START)
        {
        	NRF_LOG_DEBUG("******* BOOTLOADER_DFU_START == %d ************** \n", BOOTLOADER_DFU_START);
        	return true;
        }
    
        if (s_dfu_settings.enter_buttonless_dfu == 1)
        {
            s_dfu_settings.enter_buttonless_dfu = 0;
            APP_ERROR_CHECK(nrf_dfu_settings_write(NULL));
        	NRF_LOG_DEBUG("******* enter_buttonless_dfu == 1 ************** \n");
            return true;
        }
        return false;
    }
    

    Please find bellow the result 

    :DEBUG:Erasing: 0x0007f000, num: 1
    :DEBUG:Writing 0x00000057 words
    :DEBUG:Writing settings...
    :DEBUG:******* BOOTLOADER_BUTTON == 0 ************** 
    :DEBUG:Application sent bootloader request
    :DEBUG:In nrf_dfu_transports_init
    :DEBUG:num transports: 1
    :DEBUG:vector table: 0x00075000
    :DEBUG:vector table: 0x00075000
    :DEBUG:Error code - sd_softdevice_vector_table_base_set: 0x00000000
    :DEBUG:Before SOFTDEVICE_HANDLER_APPSH_INIT
    :DEBUG:After SOFTDEVICE_HANDLER_APPSH_INIT
    :INFO:Error code - sd_ble_cfg_set: 0x00000000
    :DEBUG:Enabling softdevice.
    SDH:DEBUG:RAM start at 0x20002060.
    :DEBUG:Softdevice enabled
    :DEBUG:After nrf_dfu_transports_init
    :DEBUG:------- nrf_dfu_flash_init-------
    :DEBUG:Waiting for events

    Do you confirm that the BOOTLOADER _BUTTON pin number is P019 (BUTTON_D) ?

    Does it means that P019 is activated ?

    Thanks,

    Olivier 

Reply
  • Hi Bjorn,

    I added the following code in nrf_dfu.c 

    __WEAK bool nrf_dfu_enter_check(void)
    {
        if (nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0)
        {
        	NRF_LOG_DEBUG("******* BOOTLOADER_BUTTON == 0 ************** \n");
        	return true;
        }
    
        if(NRF_POWER->GPREGRET == BOOTLOADER_DFU_START)
        {
        	NRF_LOG_DEBUG("******* BOOTLOADER_DFU_START == %d ************** \n", BOOTLOADER_DFU_START);
        	return true;
        }
    
        if (s_dfu_settings.enter_buttonless_dfu == 1)
        {
            s_dfu_settings.enter_buttonless_dfu = 0;
            APP_ERROR_CHECK(nrf_dfu_settings_write(NULL));
        	NRF_LOG_DEBUG("******* enter_buttonless_dfu == 1 ************** \n");
            return true;
        }
        return false;
    }
    

    Please find bellow the result 

    :DEBUG:Erasing: 0x0007f000, num: 1
    :DEBUG:Writing 0x00000057 words
    :DEBUG:Writing settings...
    :DEBUG:******* BOOTLOADER_BUTTON == 0 ************** 
    :DEBUG:Application sent bootloader request
    :DEBUG:In nrf_dfu_transports_init
    :DEBUG:num transports: 1
    :DEBUG:vector table: 0x00075000
    :DEBUG:vector table: 0x00075000
    :DEBUG:Error code - sd_softdevice_vector_table_base_set: 0x00000000
    :DEBUG:Before SOFTDEVICE_HANDLER_APPSH_INIT
    :DEBUG:After SOFTDEVICE_HANDLER_APPSH_INIT
    :INFO:Error code - sd_ble_cfg_set: 0x00000000
    :DEBUG:Enabling softdevice.
    SDH:DEBUG:RAM start at 0x20002060.
    :DEBUG:Softdevice enabled
    :DEBUG:After nrf_dfu_transports_init
    :DEBUG:------- nrf_dfu_flash_init-------
    :DEBUG:Waiting for events

    Do you confirm that the BOOTLOADER _BUTTON pin number is P019 (BUTTON_D) ?

    Does it means that P019 is activated ?

    Thanks,

    Olivier 

Children
  • HI Olivier, 

    I apologize for the late reply, I have been out of office on a business trip.

    Yes, if you enter the if (nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0), then it means that the Bootloader Button Pin is pulled low. In the pca10040.h file, the BOOTLOADER_BUTTON is defined as follows. 

    BOOTLOADER_BUTTON   == BSP_BUTTON_3 == BUTTON_4 == P0.16 

    Do you have a button on you product that you want to use to put the device in bootloader mode, if not, then you can comment out the following snippet in  nrf_dfu_enter_check

     if (nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0)
    {
    	NRF_LOG_DEBUG("******* BOOTLOADER_BUTTON == 0 ************** \n");
    	return true;
    }

    Bjørn

Related