This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why does softdevice update with DFU not work

I have a working custom DFU bootloader based on the official bootloader from the SDK 8.1.0. Updating the normal application code works without any problem. Now I want to also update the softdevice (currently S120). Therefor I generated the update .zip file with the tool included in the MasterControlPanel version 3.9.0.6. I used the following command on the CMD:

nrf.exe dfu genpkg --softdevice s120_softdevice.hex --dev-type 0xffff --dev-revision 0xffff --sd-req 0xffff SD_DFU.zip

But when uploading this .zip file to the bootloader with the nRF Connect Android App, I can see that the bootloader breaks the communication after prevalidating the init package.

I can see that dfu_init_pkt_complete(); in dfu_transport_ble.c returns NRF_ERROR_INVALID_LENGTH. This comes from the dfu_init_prevalidate(...)function in dfu_init_template.c. The check:

if (((uint32_t)p_init_data + init_data_len) < 
        (uint32_t)&p_init_packet->softdevice[p_init_packet->softdevice_len])

goes wrong, and NRF_ERROR_INVALID_LENGTH is returned. Is it a problem on the bootloader side, or is it a problem with generating/transmitting the .zip file? Any help appreciated.

BR, BTprogrammer

Parents
  • Hi Bjørn, thanks for your help. I think I found the problem. As I said, I am working with a modified bootloader. I changed the function dfu_data_pkt_handle(...) in dfu_single_bank.c and it seems that I did not take care dfu_activate_sd. I only handled dfu_activate_app and dfu_activate_eeprom. EEPROM is a new functionality that I implemented, to update a connected eeprom, too. Anyway, thanks again. BR

Reply
  • Hi Bjørn, thanks for your help. I think I found the problem. As I said, I am working with a modified bootloader. I changed the function dfu_data_pkt_handle(...) in dfu_single_bank.c and it seems that I did not take care dfu_activate_sd. I only handled dfu_activate_app and dfu_activate_eeprom. EEPROM is a new functionality that I implemented, to update a connected eeprom, too. Anyway, thanks again. BR

Children
No Data
Related