BLE Secure DFU Bootloader with nRF52832 Project Build Errors

Hi,

I'm following this "Getting started with Nordic's Secure DFU bootloader, a step by step guide" (https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader#h75sjziavjbukzaywg6xlx19np0fm4) and using the nRF5_SDK_17.1.0_ddde560\examples\dfu\secure_bootloader project. However, when I built it (at step B3 in that guide), it gave me these errors.

How may I solve them? Or are there any other example projects or guides that I can follow to program nRF52832 through BLE? I've also tried the ble_app_buttonless_dfu, and that project could be built (no errors) but the nRF52832 didn't BLE advertise after firmware loading. 

Thanks,

Han

  • I did generate the package according to the Getting started with Nordic's Secure DFU bootloader, a step by step guide tutorial for s112: nrfutil pkg generate --hw-version 52 --application-version 1 --application ble_app_buttonless_dfu_pca10040e_s112.hex --sd-req 0x103 --key-file private.key app_dfu_buttonless_s112_package.zip. I could flash it through DFU, but the board doesn't advertise afterwards (couldn't find Nordic_Buttonless when doing BLE scan).

    I already could flash my custom firmware through DFU with the secure_bootloader (the bootloader works fine with normal application), but I want to be able to flash it buttonless. I wanted to try the ble_app_buttonless_dfu example to flash DFU OTA buttonless, but that example code isn't working.

    2 ways that I've tried, but none of them work:

    1. Flash the softdevice (s112) -> secure_bootloader -> Flash ble_app_buttonless_dfu package through DFU -> Flashed sucessfully but no advertising afterwards (cannot find Nordic_Buttonless or DfuTarg in BLE scan).
    2. Flash the ble_app_buttonless_dfu directly in Segger (so with softdevice s112) through J-link -> Error at ble_dfu_buttonless_async_svci_init().
    3. Flash the softdevice (s112) -> secure_bootloader -> Flash the ble_app_buttonless_dfu hex file through J-Link -> Still see in BLE scan as DfuTarg, not Nordic_Buttonless. 

    Am I flashing the firmware for buttonless DFU wrongly? Or is there a specific tutorial/document/example code that shows exactly what needs to be changed in my custom firmware to be able to do buttonless DFU with the SDK 17.1.0?

    Thanks,

    Han

  • Hello,

    HanCatNguyen said:
    Flash the softdevice (s112) -> secure_bootloader -> Flash ble_app_buttonless_dfu package through DFU -> Flashed sucessfully but no advertising afterwards (cannot find Nordic_Buttonless or DfuTarg in BLE scan).

    This suggests the application (ble_app_buttonless_dfu) starts, but fails before it starts advertising -> resets, starts again, but fails before it starts advertising.

    HanCatNguyen said:
    Flash the ble_app_buttonless_dfu directly in Segger (so with softdevice s112) through J-link -> Error at ble_dfu_buttonless_async_svci_init().

    Yes, that is because no bootloader is present, so ble_dfu_buttonless_async_svci_init() will fail.

    HanCatNguyen said:
    Flash the softdevice (s112) -> secure_bootloader -> Flash the ble_app_buttonless_dfu hex file through J-Link -> Still see in BLE scan as DfuTarg, not Nordic_Buttonless. 

    Yes. This is because when you flash it with the programmer, no bootloader settings will be generated by the bootloader, like it will be when you perform the DFU, like you did in 1). Therefore, the application will be rejected, and it will remain in DfuTarg mode. 

    So what you need to do is what I tried to explain in the previous reply. Either, perform the DFU, flash the ble_app_buttonless_dfu directly using the debugger/programmer. If you program it with the programmer, you need to manually generate the bootloader settings and program that .hex file as well. 

    Alternatively, do what you did in 1), and then "attach debugger", like I showed in the screenshot in the previous reply, and use this debug session to figure out why it doesn't start advertising. Does the log say anything?

    Best regards,

    Edvin

Related