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

Secure Serial DFU not working

I am using the bootloader_secure_serial example from the SDK 14.0.0 on a 523832 DK. I have erased the device and flashed the softdevice and bootlader on it. The LED1 is turned on after restart, so the bootloader is in DFU mode.  

I am having trouble testing the example with the nrfutil. I installed it using pip and tried running the command

nrfutil dfu serial -pkg name.zip - /dev/ttyUSB0 -b 115200 -fc 1

I get the "No ping response after opening COM port". Its not a problem with the UART or USB2UART module, as the ble_app_uart example is working fine on the same setup.

  • Hi,

    Are LED 1 and LED 4 on the DK lit to indicate that the bootloader is in DFU mode? If not, have you remembered to flash the SoftDevice? It is needed by the bootloader in SDK 14 even if it is not using BLE. The following set of commands should work out of the box with the serial DFU example images from SDK 14.0.0 (<SDK 14.0.0>\examples\dfu\secure_dfu_test_images\serial\nrf52832):

    λ nrfjprog.exe -e
    Erasing user available code and UICR flash areas.
    Applying system reset.
    
    λ nrfjprog.exe --program softdevice_s132.hex
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    
    λ nrfjprog.exe --program bootloader_secure_serial_debug_without_bonds_s132.hex --reset
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.
    
    λ nrfutil dfu serial -pkg ble_app_buttonless_dfu_without_bonds_s132.zip -p COM25 -b 115200 -fc 1
      [####################################]  100%
    Device programmed.

  • Thanks Einar! This got me a bit further now. LED1 and 4 are lit, but I am now gettint the following error: 

    raise NordicSemiException('Did not receive checksum response from DFU target. '
    pc_ble_driver_py.exceptions.NordicSemiException: Did not receive checksum response from DFU target. If MSD is enabled on the target device, try to disable it ref. wiki.segger.com/index.php

  • I have disabled the HW flow control and I am now getting this error: 

    NordicSemiException: Unexpected Executed OP_CODE.
    Expected: 0x03 Received: 0x60
    

    Can you guys give me any pointers as to what is wrong here. I am using the _debug project and the ble_app_buttonless_duf_without_bonds zip file.

  • Hi,

    Which exact OS do you use? Do you also have a /dev/ttyACMx device that represent the serial port?

  • I'm facing a similar issue. Here are the steps followed by me:

    Environment:

    Dev OS: Linux 18.04 LTS

    SDK version 15.0.0

    Target: nRF52840-Preview DK

    1. I erased the flash: $ nrfjprog -f NRF52 --recover
    2. I flashed the softdevice: $ nrfjprog --program ~/workspace/src/SDK/components/softdevice/s140/hex/s140_nrf52_6.0.0_softdevice.hex --sectorerase --log
    3. I flashed the bootloader settings: $ nrfjprog -f nrf52 --program bl_settings.hex --sectorerase --log --reset
    4. I flashed the secure bootloader uart example: $ nrfjprog -f nrf52 --program _build/nrf52840_xxaa_mbr.hex --sectoranduicrerase --log --reset
      Please note that in this step, only changes made by me are:
      1. Changed the dfu keys
      2. increased the serial baud rate to 1M in ~/workspace/src/SDK/examples/dfu/secure_bootloader/pca10056_uart/config/sdk_config.h
      3. This should technically work as the uart example worked with flow control kept ON
    5. I create a sample package based on ble_app_hrs_freertos with nrfutil and try to update this with the DFU serial using the command: $ sudo nrfutil dfu serial -pkg build/ble_app_freertos_gcc_nrf52.zip -p /dev/ttyACM0 -b 1000000

      [------------------------------------] 0%

      <Hang here>^C

      Aborted!
      $ sudo nrfutil dfu serial -pkg build/ble_app_freertos_gcc_nrf52.zip -p /dev/ttyACM0 -b 1000000 -fc 1
      [------------------------------------] 0%
      Traceback (most recent call last):
      File "/usr/local/bin/nrfutil", line 11, in <module>
      load_entry_point('nrfutil==3.5.1', 'console_scripts', 'nrfutil')()
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
      return self.main(*args, **kwargs)
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
      rv = self.invoke(ctx)
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
      return ctx.invoke(self.callback, **ctx.params)
      File "/home/akeshava/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
      return callback(*args, **kwargs)
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/__main__.py", line 745, in serial
      do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, True)
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/__main__.py", line 680, in do_serial
      dfu.dfu_send_images()
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 129, in dfu_send_images
      self._dfu_send_image(self.manifest.application)
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 90, in _dfu_send_image
      self.dfu_transport.open()
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 206, in open
      if self.__ping() == True:
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 321, in __ping
      resp = self.dfu_adapter.get_message() # Receive raw reponse to check return code
      File "/home/akeshava/.local/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 133, in get_message
      byte = self.serial_port.read(1)
      File "/home/akeshava/.local/lib/python2.7/site-packages/serial/serialposix.py", line 501, in read
      'device reports readiness to read but returned no data '
      serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

      Does this mean that we can't use DFU over serial at 1M baud rate?
Related