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

UART DFU for nRF52833

HW setup is my boart connected to a windows10 PC with an uart link.

I tried secure_bootloader_pca10100_uart_ses_nRF5SDKThreadv4.1.0.zip example, with some modification for my board, es UART pins in custom_board.h

#define RX_PIN_NUMBER 7
#define TX_PIN_NUMBER 6
//#define TX_PIN_NUMBER 35
#define CTS_PIN_NUMBER 8
#define RTS_PIN_NUMBER 40
#define HWFC true

To validate uart pins changes I tested the uart example in examples\peripheral\uart\pca10100\blank\ses and it works fine both without HW flow control and with HW flow control.

When I send 

nrfutil dfu serial -pkg blinky_pca10100_mbr.zip -p COM5 -b 115200

it seems all freezed: RTS signal from PC goes low, but nRF52833 RTS pin remains high. If I force low that signal PC starts transmitting.

A second question

The DFU example uses (in sdk_config.h) Button for entering DFU mode and set NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN to 25: in my board I cannot access to that pin and I want to use PIN0.2.

I set in custom_board.h

#define BUTTON_4       2

and in sdk_config.h

#define NRF_BL_DFU_ENTER_METHOD_PINRESET 1

I add Enter DFU mode on pin reset

Is it correct ?

How can I debug the DFU example ?

Best Regards

Parents
  • Now  interface chip works !

    With PCA10100 board connected to PC with a usb cable on j2 connector, I programmed fw with MSD functionality, then I tried to use virtual com with nrfutil but it didn't work.

    All changes if I program the board with 

    nrfjprog -f NRF52 --sectorerase --program NORDIK_SDK_v4\examples\dfu\secure_bootloader\pca10100_uart\ses\Output\Release\Exe\secure_bootloader_uart_mbr_pca10100.hex --reset
    Now nrfutil is able to program the chip
    nrfutil dfu serial -pkg blinky_pca10100_mbr.zip -p COM6 -b 115200
      [####################################]  100%
    Device programmed.

    I want to perform another test with the PCA10100 board:

    move nRF52833 UART on other pins, using pins P1.01/02/03/04, and connect the UART to the PC with an external USB-UART serial bridge.

  • With nrfjprog I've programmed a DFU that uses an UART on P1 pins, and then dowloaded a program

    nrfutil dfu serial -pkg blinky_pca10100_mbr.zip -p COM5 -b 115200
    [####################################] 100%
    Device programmed.

    Three questions:

    1) PC UART waits 30 seconds before to lower RTS signal and start download, is it correct ?

    2) I tried to download heart_rate_demo.hex, 

    nrfutil dfu serial -pkg heart_rate_demo.zip -p COM5 -b 115200
    [####################################] 100%
    Device programmed.

    but the program seems not work because LED1 and LED3 are lit on the DK (the DK has bootloader mode active). 

    When I copy heart_rate_demo on the disk of interface MCU, the  heart_rate_demo works fine and the DK connects to the smartphone.

    What's wrong ?

    3) it is not clear for me the use of mbr: is it necessary include it with DFU bootloader ?

    Best Regards

  • Is MBR_PRESENT for DFU program or for application program ?

    > flash_placement.xml file ... from nRF5 SDK 17.

    From which project was flash_placement.xml copied ?

    Thanks

  • The flash placement file was copied from the bootloader project. It's generic and used across all configurations. The MBR_PRESENT flag is used in the bootloader configurations that don't include the Softdevice.

  • Returning on how to load an application program on a board with DFU/bootloader

    if I use

    nrfutil dfu serial -pkg blinky_pca10100_mbr.zip -p COM6 -b 115200

      [####################################]  100%

    the bootloader run the application program, 

    if I download the application program with the jlink debugger from "Segger Embedded Studio" the bootloader is running but doesn't load the application program.

    Is it correct ?

    Best Regards

  • The bootloader will not be aware of the application if it was programmed directly through the debug interface and will thus as a result fall back to DFU mode. Please read the "Combine application, bootloader and softdevice image - Bootloader setting" section at the end of this post: https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader.  It goes through the necessary steps to make the bootloader aware of the app after it has been programmed with the Jlink.

  • Now I'm able to merge MBR, bootloader, application, bootloader settings in a single file for production, and it starts and enter in bootloader mode when I press Button 4 at power-on.

    However if I set NRF_BL_DFU_ENTER_METHOD_PINRESET instead of  NRF_BL_DFU_ENTER_METHOD_BUTTON I'm not able to enter in bootloader mode (LED 1 and 3 on): the program never enters in bootloader mode with reset button also if I use nrfjprog and nrfutil or Jlink programmer and program the board in "old style" manner.

    CONFIG_GPIO_AS_PINRESET is defined in bootloader project and also in application program project.

    Which checks can I perform ?

    Thanks

Reply
  • Now I'm able to merge MBR, bootloader, application, bootloader settings in a single file for production, and it starts and enter in bootloader mode when I press Button 4 at power-on.

    However if I set NRF_BL_DFU_ENTER_METHOD_PINRESET instead of  NRF_BL_DFU_ENTER_METHOD_BUTTON I'm not able to enter in bootloader mode (LED 1 and 3 on): the program never enters in bootloader mode with reset button also if I use nrfjprog and nrfutil or Jlink programmer and program the board in "old style" manner.

    CONFIG_GPIO_AS_PINRESET is defined in bootloader project and also in application program project.

    Which checks can I perform ?

    Thanks

Children
Related