nrf52810 Not jumping Bootloader from BLE Application

Hi,

Chip : NRF52810

Soft Device : s132_nrf52_5.1.0

SDK : nrf5_sdk_for_thread_and_zigbee_v4.2.0_af27f76 (BLE BootLoader) 

IDE : Segger Embedded Studio

SDK : nRF5_SDK_14.2.0_17b948a (BLE Application) 

IDE : IAR Embedded Workbench

in BLE Application i am trying to reboot and enter to bootloader for serial DFU. 

i have checked in nrf devzone and did some changed as suggested but still it reboot and enter to BLE Application.  

BLE application main.c has been added following codes to set start bootloader 

 sd_power_gpregret_set(1,BOOTLOADER_DFU_START);     // to enable dfu_check true

nrf_nvmc_write_word(0x00022000, (uint32_t) dfu_flag);   // to enable dfu_check true

nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);     //

NVIC_SystemReset();.   //reboot to jump to bootloader

in Application sdkconfig did following changes.

#define BLE_DFU_ENABLED 1

#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 1

#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1

#define NRF_SDH_BLE_VS_UUID_COUNT 2

#define NRF_SDH_BLE_SERVICE_CHANGED 1

#define NRF_SDH_BLE_SERVICE_CHANGED 1

From bootloader dfu_enter_check() nrf_power_gpregret_get() but it never returns true.

also tries to read nvic memory to read flag to make dfu_enter_check true.

uint32_t DFU_Flag_data  = 0;

uint32_t* dfu_flag_mem2 = (uint32_t*) 0x00022000;
DFU_Flag_data = (uint32_t)*dfu_flag_mem2 ;

if(DFU_Flag_data  != 0xFFFFFFFF) dfu_enter = true;

but after NVIC_SystemReset(); the application restart without entering to dfu_check.

how can i verify and enter to bootloader after systemreset().

Both BLE Application and BLE Bootloader is tested individually and works fine.

 

  • HI,

    I was trying to verify that while booting whether the control goes to bootloader or not. 

    By writing memory from bootloader i confirmed that device is rebooting and control goes to bootloader but it fails to enter dfu mode or dfu_enter getting failed. so it start running APP.

    i understand i have to make bootloader and Application have to make compatible with same softdevice version.

    But i individually checked the application and bootloader which was working fine so i thought to merge the both.

    Q. Why memory read function getting failed from bootloader ?

     i have tried 2 methods to read memory as follows but all methods are got failed.

    can u tell why it is getting failed.

    uint32_t* dfu_flag_mem2 = (uint32_t*) 0x00022000;
    DFU_Flag_data = (uint32_t)*dfu_flag_mem2 ;
    
    
    memcpy(&dfu_flag_mem1,(uint32_t*) 0x00022000,sizeof(uint32_t));
    

  • NikhilVV said:
    But i individually checked the application and bootloader which was working fine so i thought to merge the both.

    But did you test them individually with the same Softdevice version?

    NikhilVV said:
    By writing memory from bootloader i confirmed that device is rebooting and control goes to bootloader but it fails to enter dfu mode or dfu_enter getting failed. so it start running APP.

    To debug the bootloader, I recommend either using the *_debug variant or start a debug session in your bootloader project and place breakpoints in the dfu enter check function.

    NikhilVV said:

    Q. Why memory read function getting failed from bootloader ?

     i have tried 2 methods to read memory as follows but all methods are got failed.

    It is not a problem with the read function. 

  • Q But did you test them individually with the same Softdevice version?

    Yes. Application and bootloader checked with same Softdevice  (s132_nrf52_5.1.0) and working well. 

    i hope by it will work together with BLE APP and Bootloader.

    Am not debugging bootloader. i am verifying that whether it hit or enter into bootloader or not by writting memory using nvmc_write.

    If it is not a problem with read function why did the read function is not reading the correct data from  memory location. I read the same memory using nrfjprog --memrd  and returning 12341234. 

     

  • Please remove your nvmc writes and  try debug the bootloader to find out why the DFU flag in the GPREGRET register is being cleared without the device entering DFU mode.

  • Hi,

    I have removed all nvmc writes from bootloader and tried to enter DFU mode in run mode.

    But the bootloader not entering to DFU, GPREGRET Register is setting from ble App and ble app getting rebooted .. But after rebooting it fails to enter DFU mode and jumps to Application. 

    After rebooting i rechecked the GPREGRET data and it says,

    C:\Users\DELL>nrfjprog --memrd 0x4000051c      //before 
    0x4000051C: 00000000 |....|

    C:\Users\DELL>nrfjprog --memrd 0x4000051c     //after reboot
    0x4000051C: 000000B1

    It is not clearing the data.

Related