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

UART DFU for BLE projects

Hello

I am using SDK16, and using BLE sample project (central app_ble_blinky)

when I am taking sample project without BLE , I am able to add UART secure bootloader, and I am able to sign all and update application over UART

however, when I try to do them same for BLE based project I am getting the following: 

please advice how to resolve this issue 

thank you 

  • I am not sure how you generated the package that you tried to flash. 

    Can you please try to copy the attached test.bat into the path:

    SDK16.0.0\examples\dfu\secure_bootloader\pca10040_uart\armgcc\

    and call it from the command window.

    NB: It will delete the dfu_public_key.c found in examples\dfu\secure_bootloader. If you need this key in the future, please make a backup. 

    The script will generate a new dfu_public_key.c. I included it because it needs the matching private.key in that location.

    You also need to modify the last line in the script from COM7 to whatever com port you are using.

    mkdir files
    
    del ..\..\..\dfu_public_key.c
    del ..\..\..\private.key
    nrfutil keys generate ..\..\..\private.key
    nrfutil keys display --key pk ..\..\..\private.key --format code --out_file ..\..\..\dfu_public_key.c
    
    make -j9
    make -j9 -C ..\..\..\..\ble_peripheral\ble_app_blinky\pca10040\s132\armgcc
    
    del files\blinky.hex
    copy ..\..\..\..\ble_peripheral\ble_app_blinky\pca10040\s132\armgcc\_build\nrf52832_xxaa.hex files\blinky.hex
    
    nrfutil settings generate --family NRF52 --application files\blinky.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 --key-file ..\..\..\private.key files\bl_settings.hex
    
    nrfjprog -e --snr 682654319
    nrfjprog --program ..\..\..\..\..\components\softdevice\s132\hex\s132_nrf52_7.0.1_softdevice.hex --verify --snr 682654319
    nrfjprog --program _build\nrf52832_xxaa_mbr.hex --verify --snr 682654319
    ::nrfjprog --program files\blinky.hex --snr 682654319
    ::nrfjprog --program files\bl_settings.hex --snr 682654319
    nrfjprog --reset --snr 682654319
    
    nrfutil pkg generate --application files\blinky.hex --application-version 1 --hw-version 52 --sd-req 0xCB --key-file ..\..\..\private.key files\dfu_test_image.zip
    
    nrfutil dfu serial -pkg files\dfu_test_image.zip -p COM7 -b 115200

    Let me know if it doesn't work. If it works, what differs in this script from what you do when you test?

    Best regards,

    Edvin

Related