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

Problem with UART DFU

Hi,

I'm trying to test the DFU over HCI included in the SDK examples but I can't make it work. This is all the information of the environment I'm using:

  • SDK: 10.0.0
  • Board: nRF51-DK
  • Softdevice: s130
  • Memory allocation: dual bank
  • OS: Debian testing
  • GCC version: gcc-arm-none-eabi-5_2-2015q4 (I had to modify Makefile.posix)

I'm following the next steps:

  1. Make the bootloader at $SDK_PATH/examples/dfu/bootloader/pca10028/dual_bank_serial_s130/armgcc
  2. Program the bootloader: nrfjprog -f nrf51 --chiperase --reset --program $SDK_PATH/examples/dfu/bootloader/pca10028/dual_bank_serial_s130/armgcc/nrf51422_xxac.hex
  3. Program the SoftDevice: nrfjprog -f nrf51 --reset --program $SDK_PATH/components/softdevice/s130/hex/s130_nrf51_1.0.0_softdevice.hex
  4. Finally use nrfutil 0.5.1 to send the example app through USB: nrfutil --verbose dfu serial --port /dev/ttyACM0 --baudrate 38400 --flowcontrol --package $SDK_PATH/examples/dfu/hci_dfu_send_hex/test_images_dual_bank_update_nrf51/dfu_test_app_hrm_s130.zip

And this is the output of nrfutils. It stops right after the first data packet:

Upgrading target on /dev/ttyACM0 with DFU package dfu_test_app_hrm_s130.zip. Flow control is enabled.
  [------------------------------------]    0%
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 20524
Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
PC - target: c0d14e01e0030000000400000000000000000000002c500000d989c0
target - PC: c0100000f0c0
Sending DFU init packet
PC - target: c0da4e01d701000000ffffffffffffffff01006700e6970000e517c0
target - PC: c0180000e8c0
Sending firmware file
  [------------------------------------]    1%  00:18:16
PC - target: c0e34e1eb104000000dbdc39002049c1010063c1010065c101000000000000000000000000000000000000000000000000000000000067c10100000000000000000069c101006bc101006dc101006dc10100ddc401006dc101006dc101000000000099c201006dc101006dc101006dc101006dc101006dc101006dc101006dc101006dc101006dc101006dc10100f1c301006dc101006dc1010011c401006dc1010065c401006dc101006dc101006dc101000000000000000000000000000000000000000000000000000348854600f0b8f80048004709fa0100dbdc390020401e00bf00bf00bf00bf00bf00bf00bf00bf00bf00bf00bf00bff1d170470000401e00bf00bf00bf00bf00bf00bf00bf00bf00bf00bf00bf00bff1d170470000056885f308884068ff2464b2eff30585002d01d1a64600472546064621273fbaf0b40024002500260027f0b4f92040b2004700000321094802680a430260084802680a4302600748804707480047fee7fee7fee7fee7fee7fee70000240500405405004089c40100c1dbdc010030b50b46014600202022012409e00d46d5409d4205d31d469540491b2546954040191546521e002df1dc30bd10b5431a934209d28318881803e0401e01785b1e1970521ef9d210bd03460b439b0703d009e008c9121f08dbdc042afad203e00b78d766c0
Timed out waiting for acknowledgement from device.


Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.

Possible causes:
- bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
- baud rate or flow control is not the same as in the target bootloader.
- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.

Is anyone else experiencing this problem? Am I doing anything wrong?

Thanks for your help.

Crespum.

  • @Crespum:

    Have you test and make sure UART worked normally ? There is an UART example in this folder: \examples\peripheral\uart

    Could you try to program the softdevice before programming the bootloader ? Have you made sure the bootloader started properly ? You can check by printing out something from the bootloader on UART.

  • I've tried the UART example and it works on both directions (RX/TX). I've also tried to program the SD before the bootloader without any luck.

    I'm also sure the bootloader is starting because I successfully tried to switch the default LED. Nevertheless it hangs at some point because the LED never turns off as it should after the update.

  • @Crespum: I just tested by following the same steps on a Windows machine and DFU process was fine. My nrfutil on Windows was v0.3 but I don't think there is much change in v0.5.

    You may need to sniff what happens on the UART lines or debug the bootloader to see where it stuck. Could you check if LED 3 is ON ? To enable debugging with bootloader you can have a look at question F here.

  • Even i am facing the similar issue on windows as crespum,

    Setup :

    Device : nRF52 -DK SoftDevice : s132_nrf52_2.0.0_softdevice.hex BootLoader : dual_bank_serial_s132 (build in keil)

    Command : nrfutil.exe --verbose dfu serial --package=E:\dfu_test_app_hrm_s132.zip --port=COM4 --baudrate=38400 --flowcontrol

    Upgrading target on COM4 with DFU package E:\dfu_test_app_hrm_s132.zip. Flow control is enabled. [------------------------------------] 0%Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 20360 Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.

    Timed out waiting for acknowledgement from device.

    Even i am facing the similar issue on windows as crespum, Setup : Device : nRF52 -DK SoftDevice : s132_nrf52_2.0.0_softdevice.hex BootLoader : dual_bank_serial_s132 (build in keil) Command : nrfutil.exe --verbose dfu serial --package=E:\dfu_test_app_hrm_s132.zip --port=COM4 --baudrate=38400 --flowcontrol Upgrading target on COM4 with DFU package E:\dfu_test_app_hrm_s132.zip. Flow control is enabled. [------------------------------------] 0%Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 20360 Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing. Timed out waiting for acknowledgement from device.

  • @GrandGogo: Could you let me know which hardware board you are testing with ?

    Do you see LED 3 turned on when the bootloader start ?

    You can try to read out the flash and send me the hex so I can test here.

Related