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

Buttonless DFU Debugging Problem

I'm trying to add buttonless DFU to the SDK's template application. 

Here is my setup: 

  • Soft Device 6.1.0
  • Secure Bootloader
  • Modified Template App (Added buttonless DFU)

I am able to successfully OTA upload my package .zip to the board, but the application does not run and there is no advertising.
The bootloader is there because holding button 4 and doing a reset on the dev-kit puts it into DFU.

Trying to debug the code, I can not run a debug session through Segger Embedded Studio when the bootloader is present. 
With just the APP + SD, I can step through and get to the point in services_init where ble_dfu_buttonless_async_svci_init returns: No bootloader was found


Adding a debug post build script for the bootloader settings:

C:\Python27\Scripts\nrfutil.exe settings generate --family NRF52840 --application $(ProjectDir)\Output\$(Configuration)\Exe\$(ProjectName).hex  --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex
With this added, flashing the SD, and Bootloader, and trying to debug through SES, the code just tries to run with no advertising without giving me the option to step through the code.
I've tried adding the SD, Bootloader settings, and Bootloader as Additional Load files in the debug build to no success.

Section Placement Macros:
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x100000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x40000
FLASH_START=0x26000
FLASH_SIZE=0xd2000
RAM_START=0x20002210
RAM_SIZE=0x3dde0

The same results are seen for my experiments with trying to debug the SDK's buttonless DFU app.
Any help would be appreciated,
Jeff

Parents
  • Hi Jeff,

    I encountered the same problem here. That is, checksum of app image did not match with the one stored in the generated bl settings page and therefore became stuck in DFU mode. Further debugging revealed that the there was a slight difference if I uploaded the .hex file instead of the .elf file in the build directory:

    Not sure if this is expected behavior or if it is a bug in binutils (tested with SES v.3.50). In any case, I worked around this be changing the debugger settings in SES to upload the .hex file instead. Screenshots of my configuration:

    (Post build command :  nrfutil settings generate --family NRF52840 --application $(OutDir)/$(ProjectName).hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 $(OutDir)/settings.hex)

     

     

     

     

     

  • Thanks Vidar for the prompt response!
    I got this working this afternoon after changing to my output macros. 

Reply Children
No Data
Related