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

Hi DevZone, I'm experimenting on the nrf52840 dev board with softdevice s140 (SDK v15.0.0) to enable DFU via BLE. To this end, I'm trying to flash the DFU secure bootloader, and have issues trying to enter DFU mode (LED 3 lit). Here are the steps

Repetition of the steps followed here.


(1) Generated priv key, and public_key.c file using nrfutil,
(2) generated the bootloader_settings file using nrfutil
(3) Compiled the DFU secure bootloader example under .../examples/dfu/secure_bootloader/pca10056_ble/armgcc/,
(4) Ran mergehex to generate a merged (bootloader+bootloader_settings) hex file
(5) Flashed the softdevice using ./nrfjprog --program ~/Downloads/s140_nrf52_6.0.0/s140_nrf52_6.0.0_softdevice.hex -f nrf52 --chiperase --verify
(6) Flashed the bootloader merged hex file using ./nrfjprog --reset --program .../examples/dfu/secure_bootloader/pca10056_ble/armgcc/_build/nrf52840_xxaa_s140_merged_with_settings.hex --family NRF52 --sectoranduicrerase

I expect the board to enter DFU mode now, before attempting to update the application. Is this a correct assumption?

From the documentation, following are the LED assignments: LED1: Advertising, LED2: Connected LED3: Bootloader/DFU mode. On my board, only LEDs 1 and 2 are lit up. I tried power cycling, pressing button 4, and resetting the board, LED 3 does not light up.

Parents Reply Children
  • Hi,

    Thank you for the input. I was able to see the device advertising, with the following MAC ID: 0xC0EA4548B4FA.

    I attempted to flash a package I created using: 

    nrfutil pkg generate --application .../examples/ble_peripheral/ble_app_hrs/pca10056/s140/armgcc/_build/nrf52840_xxaa.hex --key-file .../priv.pem --hw-version 52 --sd-req 0x8C --application-version 0xFF  .../examples/ble_peripheral/ble_app_hrs/pca10056/s140/armgcc/_build/nrf52840_xxaa.zip

    where 0x8C --> softdevice s140, 0xFF --> a random ID

    To flash this application over BLE:

    nrfutil dfu ble -ic NRF52 -pkg application.zip -p /dev/ttyACM0 -a C0EA4548B4FA

    where I tried 2 application zipped files: .../examples/dfu/secure_dfu_test_images/ble/nrf52840/hrs_application_s140.zip and .../examples/ble_peripheral/ble_app_hrs/pca10056/s140/armgcc/_build/nrf52840_xxaa.zip.

    In both cases, I see the following failure.

    raise NordicSemiException('Failed to {}. Error code: {}'.format(wrapped.__name__, err_code))
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to open. Error code: 13

    I tried the command with sudo, still see the same error. Could you help, please?

    Thanks and regards,

    Shubhangi

  • I have not seen this issue myself, but perhaps this thread is relevant. Which toolchain are you using to build the bootloader?

    And which version of nrfutil do you have ("nrfutil version")?

     

Related