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

nrf52833 s113 DFU Package generation

Hi all :) ,

I'm trying to create my new zip folder with new image.

I connect to my nrf52833, then i click on dfu button into nrfConnect mobil app. 

I selec zip file option and strat uploading. Then the uC disconnect and restart. In the console, i see : 

<debug> nrf_sdh_ble: BLE event: 0x51.<CR>
<debug> nrf_sdh_ble: BLE event: 0x53.<CR>
<info> app: Device is preparing to enter bootloader mode.<CR>
<debug> app: Disconnected connection handle 0<CR>
<info> app: Disconnected 1 links.<CR>
<debug> app: In ble_dfu_buttonless_bootloader_start_finalize<CR>
<CR>
<info> app: Device will enter bootloader mode.<CR>
<info> app: Power management wants to reset to DFU mode.<CR>
<info> app: Power management allowed to reset to DFU mode.<CR>

When i scan, i see DfuTarg , i connect to it and according to the documentation, at the connexion to the advertiser bootloader, it should update application. But nothing happen it stay connected. after may be 1 minute, it exit but my old application start so update ahas not worked . 

I tried unsigned image but same result. I tried to increase application number too , same bad result.

Can you sum up please the different steps in order to be sure my config is ok please ? From bootloader program build ( with private key taken into account) , generation of settings.hex ?

All is a bit confusing with these files everywhere lol. I think i miss an obvious step somewhere and i also confuse between softdevice, bootloader files etc what to merge with merghex utilities etc ..

Hope my question is not to wide but i'm a bit lost with the seeral step and the order to proceed to be clean. As dfu process will be integrated to our own application, we need to really manage in a proper way all the steps to avoid having customers stuck with a corrupted device :D

Thank you very much !

  • Hi ,

    I found the good documentation, sorry to have have search enough before to ask on the forum : 

    https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Flib_bootloader_dfu_validation.html&anchor=lib_bootloader_signatures

    So I start from zero. Create private , public key, put it in secure bootloader, and then flash with nrfConnect 3.4.0 the four files : softdist.hex myApplication.hex, bootloader.hex and the bootloader setting page.

    I needed to add an option to generation packqge to have it working: --app_boot_validation VALIDATE_ECDSA_P256_SHA256.

    Q1)

    But when i flash like this, bootloader is not able to start normally my application. I can do the dfu via le of my zipped signed package. But the application flashed at " production step" is not started because not signed i guess. How to allow my initial application to start after flashing the four files please? Is it just a matter of not signed app?

    Q2)

    I have an upload rate of 8.3kB ( i was at 50cm from the devBoad), is it normal ? It seems to be slow .

    Thank you

  • Hello,

    Could you post the commands you use to generate the bootloader settings page (Generating and displaying bootloader settings)?

    1. It sounds like a problem with the bootloader settings page. Please try to generate the settings page without the enabling boot validation of the app (--app_boot_validation) and see if you get the same result (the bootloader falls back to dfu mode if this validation fails).

    2. It may be slightly faster or slower depending on the phone you use, but 8.3 kB (bytes?) is pretty quick. I got 9-10 kB/s with my iPhone 8 for comparison, and with this transfer rate, it will only take a few seconds to update a regular-sized SDK app.

  • Hi  thanks for the reply,

    here is the command i'have used to generate the zip:

    nrfutil pkg generate --hw-version 52 --sd-req 0xCC --application-version 2 --application myapp.hex --key-file private_key.pem myapp_inc_signed.zip --app-boot-validation VALIDATE_ECDSA_P256_SHA256

    Without --app-boot-validation VALIDATE_ECDSA_P256_SHA256, after programming , it reset, i see dfuTarg advertising, i connect click dfu button dl the myapp_signed.zip , it try to upload, 1time , 2time , 3 times and disconnect, i reconnect , it disconnect, and continu to advertise dfu targ but application doesn't start.

    So with the option i can at least upload, and appllication strt only after uploading with dfu ble and not when application has been written by wire. And without the option, even upload doesn't work.

    Ok concerning speed, it is a samsung 7 so quiet recent. SO this speed is normal :)

  • Hi,

    Olfox said:
    So with the option i can at least upload, and appllication strt only after uploading with dfu ble and not when application has been written by wire.

     This option is required if you've built the bootloader with NRF_BL_APP_SIGNATURE_CHECK_REQUIRED enabled in sdk_config.h. And when you programing everything through the debug interface (Softdevice+bootloader+app) you also need to generate and program the settings page to inform the bootloader that a valid app exists. See "Generating and displaying bootloader settings" for steps to generate the settings page.

     

  • Hi Vidar !  thank you. I have generated my setting page. without it i can t start my app. How to proceed to  have debug mode with ses when signed image is used please ? Is it possible ? Also i don t know why bootloader doesn t start my signed application when it is flashed at the same time than bootloader setting page and soft device. App start only after uploading the zip file via dfu.

Related