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

sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader

My setup of the buttonless BLE DFU secure bootloader using SDK15.2 isn't launching the application after a successful OTA package transfer.  Using RTT and breakpoints, I narrowed down the issue to sd_softdevice_disable() inside nrf_sdh_disable_request(). The bootloader code execution disappears inside the SVCALL to disable the softdevice. What could be causing this behavior? 

I'm finding it really difficult to narrow down the cause. My bootloader implementation matches almost identically with the examples except for: using bonds, buttonless DFU service, VS_UUUID_COUNT set to 2, RTT ON and in the same RAM section as the application, flash start/size for the bootloader, using the RC clock source. I set the RAM start and size to:

RAM (rwx) :  ORIGIN = 0x20007978, LENGTH = 0x38688 

Parents
  • Hi,

    So the program does not return from sd_softdevice_disable()? I haven't experienced that before. Can you read out the Core registers while the code is "stuck"? You can do this with the --readregs command in nrfjprog. E.g., nrfjprog --readregs. I would be happy to try debugging it here as well if you are able to share your project. 

  • Thank you for the offer to help debug! I just discovered a few things that seem to have fixed it: First, because I moved the RTT buffer RAM section around, I couldn't get proper logging until I power-cycled the nrf52. Second, I reduced the RTT number of buffers. And the biggest discovery was perhaps that I was enabling mem_manager and compiling the associated files leading to ; I had done that because sdk_config.h in the example has it enabled. 

Reply
  • Thank you for the offer to help debug! I just discovered a few things that seem to have fixed it: First, because I moved the RTT buffer RAM section around, I couldn't get proper logging until I power-cycled the nrf52. Second, I reduced the RTT number of buffers. And the biggest discovery was perhaps that I was enabling mem_manager and compiling the associated files leading to ; I had done that because sdk_config.h in the example has it enabled. 

Children
No Data
Related