This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Implementing DFU trigger library

Board: nRF52833

SoftDevice: s140

SDK version: 17.0.2

I am trying to implement OTA buttonless DFU feature in my custom device (USB Device) which is a central device. So I integrated the buttonless DFU feature into my application and tested it in my nRF52833 DK and it works fine. When testing in my USB custom device it gives a "Bootloader not found" error. Seems like I need to add the DFU trigger library to enter the bootloader. 

1. Am I right here?

Then I integrated the DFU trigger library as given in the example \examples\connectivity\ble_connectivity\Main.c. I got the "This module is intended to be used with boards that have the GP pin shortened with the RESET pin." error message. So I've defined the P0.18 pin to BSP_SELF_PINRESET_PIN as it was given in the nRF52833 pinout and the error message went out.

2. Can I use pin 18 as the reset pin to trigger RESET pin as I have no other GPIO connected to it?

Then I tried to test the application but still, I am getting the same error.

How can I solve this issue? Thanks in advance.

Parents
  • Hi Nabeel, 

    Could you point me to the DFU trigger library you are using ? 

    If you are trying to do Buttonless DFU you may want to have a look at this example: \examples\ble_peripheral\ble_app_buttonless_dfu

    I don't think it has anything to do with the  GP pin shortened with the RESET pin. 

    Please let me know how you are planning to do DFU update ? Is the USB device advertising as a peripheral and get connected by a phone ? 

    Regarding  "Bootloader not found" error, this means you need to flash the bootloader to be able to use the buttonless service. 

    I would suggest to get familiar with the bootloader before you implement the buttonless service. I have a tutorial here that might be useful for you. 

Reply
  • Hi Nabeel, 

    Could you point me to the DFU trigger library you are using ? 

    If you are trying to do Buttonless DFU you may want to have a look at this example: \examples\ble_peripheral\ble_app_buttonless_dfu

    I don't think it has anything to do with the  GP pin shortened with the RESET pin. 

    Please let me know how you are planning to do DFU update ? Is the USB device advertising as a peripheral and get connected by a phone ? 

    Regarding  "Bootloader not found" error, this means you need to flash the bootloader to be able to use the buttonless service. 

    I would suggest to get familiar with the bootloader before you implement the buttonless service. I have a tutorial here that might be useful for you. 

Children
  • Hi,

    Could you point me to the DFU trigger library you are using ?

    Its in \components\libraries\bootloader\dfu\nrf_dfu_trigger_usb.c and  \components\libraries\usbd\class\nrf_dfu_trigger\app_usbd_nrf_dfu_trigger.c

    Please let me know how you are planning to do DFU update ? Is the USB device advertising as a peripheral and get connected by a phone ?

    I'm trying to do Buttonless DFU to my custom USB device which acts as a central. My USB device will do the scanning and I'll connect it with my nrf connect mobile app (advertiser). I'll initiate the dfu process by clicking the dfu icon in the top right of nrf connect app and I'll select the zip file and upload it. But it shows "Bootloader not found" error message.

    Regarding  "Bootloader not found" error, this means you need to flash the bootloader to be able to use the buttonless service. 

    I've flashed pca10100_s140_ble bootloader in it. 

  • Hi again Nabeel, 

    I assume by "pca10100_s140_ble bootloader" you mean the bootloader in "\examples\dfu\secure_bootloader\pca10100_s140_ble"  ? 


    I would suggest to get familiar with this bootloader before you move to any further step. Make sure you can do a DFU update with this bootloader before trying to implement DFU buttonless.

    Note that the bootloader, out of the box, works as a peripheral, not a central. You would need to modify it to make it a central with the same services and characteristics. 

    The DFU trigger library nrf_dfu_trigger_usb.c has nothing to do with the DFU buttonless. It requires a button to be pressed to put the device to DFU mode. So it may not relevant to your application. 

    What you need to do is to study the \examples\ble_peripheral\ble_app_buttonless_dfu and implement the DFU buttonless service in your application. 

  • Hi,

    I assume by "pca10100_s140_ble bootloader" you mean the bootloader in "\examples\dfu\secure_bootloader\pca10100_s140_ble"  ? 

    Yes.

    I would suggest to get familiar with this bootloader before you move to any further step. Make sure you can do a DFU update with this bootloader before trying to implement DFU buttonless.

    I've tried flashing bootloader, softdevice and bootloader setting page in my nRF52833 DK and my custom board. It works fine in DK where I can upload the zip packet and also application runs fine. But while flashing in my custom USB board it doesn't even advertise as "Dfutarg".

    why it is so?

  • Hi Nabeel, 

    Please check if you have 32kHz crystal on your board ? 
    If you only flash the softdevice + bootloader would it advertise DFUTarg ? 

    If it doesn't you may want to flash the debug version of the bootloader and step into the code and check why it doesn't advertise. You can debug the bootloader the same way as debugging normal application. 

  • Hi,

    Please check if you have 32kHz crystal on your board ?

    We have an internal 32MHz crystal but no low-frequency 32kHz crystal connected to it. Is it important to have connected?

    If you only flash the softdevice + bootloader would it advertise DFUTarg ? 

    No, it doesn't advertise as Dfutarg. When I debug I am getting the following in the log

    <info> app: Inside main
    <debug> app: In nrf_bootloader_init
    <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    <debug> nrf_dfu_settings: Using settings page.
    <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <info> app: Boot validation failed. No valid app to boot.
    <debug> app: DFU mode because app is not valid.
    <info> nrf_bootloader_wdt: WDT is not enabled
    <debug> app: in weak nrf_dfu_init_user
    <debug> app: timer_stop (0x20002B04)
    <debug> app: timer_activate (0x20002B04)
    <info> app: Entering DFU mode.
    <debug> app: Initializing transports (found: 1)
    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x00072000
    <debug> nrf_dfu_ble: Enabling SoftDevice.
    <debug> nrf_dfu_ble: Configuring BLE stack.
    <debug> nrf_dfu_ble: Enabling the BLE stack.
    <debug> nrf_dfu_ble: No advertising name found
    <debug> nrf_dfu_ble: Using default advertising name
    <debug> nrf_dfu_ble: Advertising...
    <debug> nrf_dfu_ble: BLE DFU transport initialized.
    <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
    <debug> app: Enter main loop
    

    Appriciate your help.

Related