Upgrade from s140 to s340

Reference to my old work where I sucessfully upgraded an s140 based application to s340 (ANT supported) application here:

 Replacing s140 with s340 softdevice 

Now we have decided to change the bootloader name from simple DfuTarg to Dfu_ABCD_C where ABCD is short for the MAC address of the device to identify individual device. 

Before uplaoding the s340 based app, there is an intermediate step where I upload s140 based app but with modified bootloader which allows the s340 based app to be uploaded. The s140 bootloader by default does not allow to firmware to be replaced by an s340 based app. It i son this step where I'm facing problems.

I am using the same bootloader project as before and following the same steps. But the first half of upload is complete (bl+sd), the app.hex does not upload. The nRFConnect app gets stuck after bl+sd upload successful and then gives time out error.

I get the following error message:

I have attached the log file of the bootloader and the package generation command is:

nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 1 --application app.hex --application-version 2 --application-version-string "2.0.0" --hw-version 52 --sd-req 0xB9 --sd-id 0xCA --softdevice s140_nrf52_7.0.1_softdevice.hex --key-file private.pem FW_Hotshot_hv_fv_3_files.zip

Log file: 

SN: Is there a way to directly replace an s140 based app to s340 one?

Parents
  • Found the solution of it by:

    1. First upload the modified bootloader (only) file
    2. Upload the modified bootloader + new SD + new app

    To create new bootloader package this command is used: nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 1 --hw-version 52 --sd-req 0x00 --key-file private.pem dfu_bootloader_package.zip

    To create new BL+SD+APP package, this command is used: nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 2 --application app.hex --application-version 2 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x00 --sd-id 0xB9 --softdevice ANT_s340_nrf52840_6.1.1.hex --key-file private.pem Converter_package.zip

    This process was done to convert normal BLE (SD = s140_nrf52_7.0.1_softdevice.hex) devices into ANT capable devices (SD = ANT_s340_nrf52840_6.1.1.hex).

    The new bootloader changes were as follows:

    • Removed the softdevice compatibility to make  s340 work
    • NRF_DFU_APP_ACCEPT_SAME_VERSION 0, to accept firmware with different version
    • NRF_DFU_APP_DOWNGRADE_PREVENTION 0 for ANT/BOOST
    • #define NRF_DFU_EXTERNAL_APP_VERSIONING 0 for ANT/BOOST
Reply
  • Found the solution of it by:

    1. First upload the modified bootloader (only) file
    2. Upload the modified bootloader + new SD + new app

    To create new bootloader package this command is used: nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 1 --hw-version 52 --sd-req 0x00 --key-file private.pem dfu_bootloader_package.zip

    To create new BL+SD+APP package, this command is used: nrfutil pkg generate --bootloader bootloader.hex --bootloader-version 2 --application app.hex --application-version 2 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x00 --sd-id 0xB9 --softdevice ANT_s340_nrf52840_6.1.1.hex --key-file private.pem Converter_package.zip

    This process was done to convert normal BLE (SD = s140_nrf52_7.0.1_softdevice.hex) devices into ANT capable devices (SD = ANT_s340_nrf52840_6.1.1.hex).

    The new bootloader changes were as follows:

    • Removed the softdevice compatibility to make  s340 work
    • NRF_DFU_APP_ACCEPT_SAME_VERSION 0, to accept firmware with different version
    • NRF_DFU_APP_DOWNGRADE_PREVENTION 0 for ANT/BOOST
    • #define NRF_DFU_EXTERNAL_APP_VERSIONING 0 for ANT/BOOST
Children
No Data
Related