Application crashes during buttonless DFU attempt

Hi, I am trying to implement buttonless DFU on my nRF52832 on PCA100040. After using the NRF Connect app to initialize DFU, the DFU log on the app gets to the line

Response (Op Code = Enter Bootloader, Status = Success) received.

upon which the log stops and the application seems to crash. Printing to standard output from the device abruptly stops also and the device needs to be manually reset using the button. Could this be a memory issue?

EDIT: I have determined that the device gets through all the buttonless DFU reset process and does go through the system reset into DFU mode. So I guess the issue is that the bootloader doesn't load the new update and run it correctly. 

Parents Reply Children
  • Hi, I have some additional information, so when I try DFU it stops at where I assume the device is supposed to reboot into bootloader mode, but it does not. At this time, if I hit the physical reset button on the device, the original app already on the device just reloads and runs. However, if I use the command 

    `nrfjprod -f nrf52 --reset`
    at the time where the process stops, the DFU process actually goes through and runs successfully, as indicated on the NRFConnect app.

  • Hi,

    Based on your description it seems like there is an issue that your application can not trigger a soft reset. It manages to write the retained register GPREGRET but it could not reset. 

    Did you test this with our buttonless example and do you get the same behaviour there? 

    Hung explains a bit more about the buttonless procedure in this blog post, where you also will find the the example. In this code, pay attention to uint32_t ble_dfu_buttonless_bootloader_start_finalize(void) 
    as seen in the picture below: 

    This is where GPREGRET is written, but the reset is not triggered right away. nrf_pwr_mgmt_shutdown() is called to start the shutdown process (soft reset). For some reason the reset was not trigger in your application.

    If you follow the application to where it the reset is triggered, are you able to log if your application enters that function call? 


    Kind regards,
    Andreas


  • Hi, I actually figured out the problem. My NRF_LOGGING is not working and I think when it tries the final flush, it crashes/stalls the application, preventing the shutdown.

Related