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

  • nrfjprog --memrd 0x10001200
    0x10001200: 00000015                              |....|

    and

    nrfjprog --memrd 0x10001204
    0x10001204: 00000015                              |....|

    It seems not setted the right pin

    shuld I reprogram the register with

    nrfjprog --memwr 0x10001200 --val 0x12 --verify

    and

    nrfjprog --memwr 0x10001204 --val 0x12 --verify

    ??

  • It appears to be mismatch between your project configuration and chip target. Make sure the project is built with 'system_nrf52833.c' and not system_nrf52.c

  • The project was built with 'system_nrf52.c': I changed it with 'system_nrf52833.c' and now reset button works.

    I also checked

    nrfjprog --memrd 0x10001200
    0x10001200: 00000012                              |....|

    The project includes also ses_startup_nrf52.s;

    should I change it with ses_startup_nrf52833.s ?

    If I want to test NRF_BL_DFU_ENTER_METHOD_GPREGRET:

    I'm adding

    NRF_POWER->GPREGRET = (uint8_t val) 0x1;

    in an application program.

    Is it all needed to enter in DFU mode or it is needed to force a soft reset ?

    Thank you

    Best Regards

  • rcerati said:
    The project includes also ses_startup_nrf52.s;

     That means your project is configured for the 52832 (pca10040 board), not the 52833 (pca10100). You should go over the linker settings as well as the startup files to verify it matches your device.

    rcerati said:
    NRF_POWER->GPREGRET = (uint8_t val) 0x1;

     The bootloader will enter DFU mode only if GPREGRET contain the value 0xB1 (BOOTLOADER_DFU_START)

    Best regards,

    Vidar

  • > The bootloader will enter DFU mode only if GPREGRET contain the value 0xB1

    Ok, but how to switch from application program to bootloader ?

    Is it needed to force a soft reset ? and how ?

    nRF52833 DS refers to SYSRESETREQ (5.3.6.4 Soft reset), but it is not clear for me.

    Best Regards

Reply Children
Related