Overwrite Softdevice by application using Thread Secure DFU

Nordic DevZone
Nordic DevZone

Hi everyone,

I would like to overwrite my SoftDevice wchich I don't use in my application. I found information about updates without Softdevice. 

Its possible to update application without SD? I would like to change start app address from 0x26000 (1st application which contains SD) to 0x1000 (after MBR - 2nd app without SD). 

I tried to prepare image pkg with sd-req 0x00

nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 60608 --application app.hex --key-file board_dfu_upgrade_key.pem customer-pkg.zip

I was able to download dfu image but BL didn't activate it.  

Could I overwrite SoftDevice by application via DFU or/and should I update BL too? 

BR

PB

  • Hi,

    It is possible to replace the Softdevice through DFU if the bootloader is correctly configured for it. Have you disabled the NRF_DFU_APP_DOWNGRADE_PREVENTION setting in your bootloader? The bootloader will refuse the update otherwise.

    Best regards,

    Vidar

  • Hi Vidar,

    Thanks for reply.

    Yes, I have NRF_DFU_APP_DOWNGRADE_PREVENTION disabled.

    In my old app there is s140_nrf52_6.1.0 (SDK-2) included. New APP doesn't need SD so I would like to remove It. In the other case if I would like to update SD to s140_nrf52_7.0.1 (SDK-4) app start address should be move:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xC3000

     to

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xC2000

    In my opinion, update bl+sd can brick device, because app start address is different than storedin flash.

    Could you tell me if this nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 60608 --application app.hex --key-file board_dfu_upgrade_key.pem customer-pkg.zip should overwrite SD by APP if I set flash addr to 0x1000? 

  • Hi,

    In my opinion, update bl+sd can brick device, because app start address is different than storedin flash.

    The app is always marked as invalid after a bl+sd update. This prevents the new bootloader from potentially booting a corrupted or incompatible app. There is also the app boot validation  (Boot validation) that verifies the integrity of the image before booting it.

    Could you tell me if this nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 60608 --application app.hex --key-file board_dfu_upgrade_key.pem customer-pkg.zip should overwrite SD by APP if I set flash addr to 0x1000? 

    The bootloader has no way of knowing if the binary has been linked to the correct start address. Whether the app gets allowed to overwrite the Softdevice is determined by the sd-req field and if the bootloader is configured to support it.

    Are you doing DFU over serial so the bootloaader is not depentent on the Softdevice for receiving the images?

  • Hi,

    Are you doing DFU over serial so the bootloaader is not depentent on the Softdevice for receiving the images?

    I try to do DFU over Thread.

    My old BL has configured sd_req = 0xAE (SD.6.1.0). Should I update BL with sd_req = 0x00 and then try update APP again? 

    BR

  • I see. And is the bootloader built without BLE support as well (i.e. without BLE_STACK_SUPPORT_REQD flag and BLE dfu transport)

Related