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.

Parents
  • 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?
Reply
  • 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?
Children
Related