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

nRF52840 Dongle, PCA10059 DFU Trigger library

Hello I'm trying to implement the DFU Trigger library into my project. to get following function:

" When the trigger library is added to an application, it allows a connected USB host to remotely tell the app to reboot into the bootloader to allow it to be updated via DFU. When asked to enter bootloader mode, it pulls its own reset pin using the GPIO pin BSP_SELF_PINRESET_PIN (by default, only available on PCA10059). As a consequence, the library requires the following:

  • a GPIO pin connected to the RESET pin which is true for the PCA10059 dongle,
  • a bootloader that enters DFU mode on pin reset. "

I want to load Firmware updates to the Dongle without pressing the reset button.

In the main.c I've addded following code, I wasn't sure if i had to add some defines in the sdk_config.h:

#include "nrf_dfu_trigger_usb.h"
#include "app_usbd.h"
#include "boards.h"
#define BOARDS_WITH_USB_DFU_TRIGGER  1
#define NRF_DFU_TRIGGER_USB_INTERFACE_NUM 1
#define NRF_DFU_TRIGGER_USB_USB_SHARED 1
#define BOARD_PCA10059 1
#define BSP_INIT_NONE    0
#define BSP_INIT_LEDS    (1 << 0
#define BSP_INIT_BUTTONS (1 << 1)
const app_usbd_config_t * usbd_config = NULL;
...
int main(int argcchar *argv[])
{
    app_usbd_init(usbd_config);
    bsp_board_init(BSP_INIT_LEDS);
...
}
ERROR:
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/nrf_dfu_trigger_usb.c.o: in function `nrf_dfu_trigger_usb_init':
/workspaces/./third_party/NordicSemiconductor/components/libraries/usb/nrf_dfu_trigger_usb.c:221: undefined reference to `app_usbd_class_append'
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/nrf_dfu_trigger_usb.c.o:(.rodata.m_app_dfu+0x4): undefined reference to `app_usbd_nrf_dfu_trigger_class_methods'
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/main.c.o: in function `main':
/./app/main.c:174: undefined reference to `app_usbd_init'
collect2: error: ld returned 1 exit status
Makefile:360: recipe for target 'build' failed
make: *** [build] Error 1

I've added following librarys to my makefile:

  $(NORDIC_ROOT)/components/libraries/usb/app_usbd.c \
  $(NORDIC_ROOT)/components/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c \
  $(NORDIC_ROOT)/components/libraries/usb/app_usbd_string_desc.c \
  $(NORDIC_ROOT)/components/libraries/usb/nrf_dfu_trigger_usb.c \
  $(NORDIC_ROOT)/components/libraries/usb/app_usbd_nrf_dfu_trigger.c \
...
  -I$(NORDIC_ROOT)/config \
  -I$(NORDIC_ROOT)/components/libraries/usb \
  -I$(NORDIC_ROOT)/components/libraries/block_dev \
  -I$(NORDIC_ROOT)/components/libraries/usb/config \
  -I$(NORDIC_ROOT)/components/libraries/usb/class \
  -I$(NORDIC_ROOT)/components/libraries/usb/class/cdc \
Any advices ? Slight smile
Parents Reply Children
  • I still have following problem, do you have any ideas?

    /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/nrf_dfu_trigger_usb.c.o:(.rodata.m_app_dfu+0x4): undefined reference to `app_usbd_nrf_dfu_trigger_class_methods'
    collect2: error: ld returned 1 exit status
    Makefile:361: recipe for target 'build' failed

    And when it finaly work, how can i trigger the dongle to get into bootloader mode? I'm using Nrfutil and NRF connect desktop to load the firmware.

Related