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.

  • I tried using nrfutil in a Windows machine and it worked. This means there is probably an issue with the serial port configuration in Linux, but I couldn't solve it yet.

  • @Hung

    Could you let me know which hardware board you are testing with ? PCA10040

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

    You can try to read out the flash and send me the hex so I can test here ? how i can send the complete flash data

    **When i am using zip file provided in SDK getting below error **

    C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio>nrfutil.exe dfu serial --package=E:\fw\nRF5_SDK_11.0.0_89a8197\examples\dfu\hci_dfu_send_hex\test_images_dual_bank_update_nrf52\dfu_test_app_hrm_s132.zip --port=COM4 --baudrate=38400

    Upgrading target on COM4 with DFU package E:\fw\nRF5_SDK_11.0.0_89a8197\examples\dfu\hci_dfu_send_hex\test_images_dual_bank_update_nrf52\dfu_test_app_hrm_s132.zip. Flow control is disabled. [------------------------------------] 0%Timed out waiting for acknowledgement from device.

    From nRFGO application when i provide hex file its working fine :

    STATUS: C:/Program Files (x86)/Nordic Semiconductor/nRFgo Studio/nrfutil.exe dfu genpkg C:/Users/Gogo/AppData/Local/Temp/TempDFUPackage_Mn9260.zip --sd-req 0xFFFE --application-version 0 --dev-type 0 --dev-revision 0 --application

    E:/fw/nRF5_SDK_11.0.0_89a8197/examples/dfu/hci_dfu_send_hex/test_images_dual_bank_update_nrf52/dfu_test_app_hrm_s132.hex

    STATUS: Zip created at C:/Users/Gogo/AppData/Local/Temp/TempDFUPackage_Mn9260.zip STATUS: C:/Program Files (x86)/Nordic Semiconductor/nRFgo Studio/nrfutil.exe dfu serial --package=C:/Users/Gogo/AppData/Local/Temp/TempDFUPackage_Mn9260.zip --port=COM4 --baudrate=38400

    STATUS: Upgrading target on COM4 with DFU package

    C:\Users\Gogo\AppData\Local\Temp\TempDFUPackage_Mn9260.zip. Flow control is disabled. STATUS: Device programmed.

  • @GrandGoGo: Could you send me the hex file so I can test here ? Would the nRFGo Studio works with any file (for example the example hex file in the SDK mentioned in the question ? ) It's a little bit strange because under the hood, nRFGo Studio use nrfutil to do DFU.

  • @Hung was able work with different sample .hex files generated from keil(pca10040, with soft device 132 ),

Related