Implement ble_app_usbd_cdc_acm on NRF52840 dongle with DFU mode

Hi,

I have successfully adapting nRF5 SDK projects(ble_app_uart and usbd_cdc_acm example project) for the nRF52840 dongle by following the nRF52840 Dongle Programming Tutorial, and can run both projects which are flash via nRF Connect Programmer.

And I'm trying merge two example become ble_app_usbd_cdc_acm, it works well, and it can successfully debugging and run(without the nordic offically USB DFU bootloader).

But I try to flash the hex into NRF52840 dongle(which with nordic offically USB DFU bootloader) via nRF Connect Programmer, the program doesn't work.

Here are my development environment and setup:

IDE: Segger Embedded Studio

SDK: nRF5 SDK(17.1.0)

Linker configuration: FLASH_START=0x27000;FLASH_SIZE=0xd9000;RAM_START=0x20002ae8;RAM_SIZE=0x3d518

Parents
  • Hi, 



    I have successfully adapting nRF5 SDK projects(ble_app_uart and usbd_cdc_acm example project) for the nRF52840 dongle by following the nRF52840 Dongle Programming Tutorial, and can run both projects which are flash via nRF Connect Programmer.

    Please explain what exactly you did by saying "which are flash via nRF Connect Programmer" 
    Flashing via NRF Connect Programmer can be both direct flashing via SWD interface and via the DFU mechanism. 

    I'm trying merge two example become ble_app_usbd_cdc_acm, it works well, and it can successfully debugging and run(without the nordic offically USB DFU bootloader).

    How did you program and on which hardware did you run that firmware ? 

  • Hi Hung,

    1. Flash via nRF Connect Programmer means that the dongle has already flash the dfu bootloader firmware(examples\dfu\open_bootloader\pca10059_usb_debug). The dongle can enter DFU mode, and can flash the built hex via the nRF Connect Programmer, the ble_app_uart  and usbd_cdc_acm example(after adapting) are work fine after flash.

    But the program(ble_app_usbd_cdc_acm), only can work with no dfu bootloader(which means that I have to erase entire chip first, than use IDE to flash the built hex via SWD interface to run/debug the program), If the chip contain the dfu bootloader, I cannot debug or run the program(flash hex via SWD or DFU mechanism).

    The attachment is the ble_app_usbd_cdc_acm project.

    ble_app_usbd_acm.rar

    2. The hardware is the nrf52840 dongle, program the dongle use jlink via SWD interface, and use nRF Connect for Desktop's Programmer APP via DFU mode. 

  • Hi Frank,

    You may want to remove CONFIG_GPIO_AS_PINRESET. As far as I know the bootloader would use the pin to detect if you should enter DFU mode or not. 
    If it doesn't work, you may want to go back to what you modified and revert back. I assume you started with ble_app_uart  and add the code of usbd_cdc_acm in ? I would suggest to try testing with an empty main.c just a while(1) to see if you can jump to application or not. You can bring an LED, or use SWD to step in the code. 
    Note that you can also debug the bootloader, if you debug from open_bootloader project. 

  • Hi Hung,

    1. I have remove CONFIG_GPIO_AS_PINRESET.

    2. Yes, I started with ble_app_uart, and add the code of usbd_cdc_acm in. And I have try with an empty main.c just a while(1), but I cannot jump into application(with bootloader).

Reply Children
Related