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

Updating firmware with dfu bootloader

Hi,

i would like to program my module nRF52840 via uart.

I generated private then public key using nrfutil.exe tool

i could programm softdevice and bootloader and flash them on my nRF52840.

I use : https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fbledfu_example_serial.html

now i want to update firmware, first i'm testing an existing package : softdevice_s140.zip (nRF5_SDK_15.0.0_a53641a\examples\dfu\secure_dfu_test_images\uart\nrf52840)

so i try to execute this cmd : 

D:\Work\nRF5_SDK_15.0.0 ble_telechargement_uart\examples\dfu\secure_dfu_test_images>nrfutil.exe dfu serial --package softdevice_s140.zip --port 4 -fc 1 : here is the result : 

D:\Work\nRF5_SDK_15.0.0 ble_telechargement_uart\examples\dfu\secure_dfu_test_images>nrfutil.exe dfu serial --package softdevice_s140.zip --port 4 -fc 1
  [------------------------------------]    0%
Traceback (most recent call last):
  File "nordicsemi\__main__.py", line 987, in <module>
  File "site-packages\click\core.py", line 722, in __call__
  File "site-packages\click\core.py", line 697, in main
  File "site-packages\click\core.py", line 1066, in invoke
  File "site-packages\click\core.py", line 1066, in invoke
  File "site-packages\click\core.py", line 895, in invoke
  File "site-packages\click\core.py", line 535, in invoke
  File "nordicsemi\__main__.py", line 745, in serial
  File "nordicsemi\__main__.py", line 680, in do_serial
  File "nordicsemi\dfu\dfu.py", line 121, in dfu_send_images
  File "nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image
  File "nordicsemi\dfu\dfu_transport_serial.py", line 200, in open
pc_ble_driver_py.exceptions.NordicSemiException: Serial port could not be opened on {0}. Reason: could not open port '4': WindowsError(2, 'Le fichier sp\xe9cifi\xe9 est introuvable.')
Failed to execute script __main__

on windows device manager , i have  : Jlink CDC UART Port (COM4) and USB Serial Port (COM5), i also tryed with com 5.

what is th correct arg pls ?

Parents Reply
  • Hi,

    Good to hear you are making progress. To program a nRF52840 from another microcontroller via UART you need to make your own DFU master for the other microcontroller (while the nRF52840 will be your DFU target).

    You can have a look at the sequence chart here, to see the opcodes and message sequence that need to be sent from the DFU master/controller.

    It's also suggested that you get hold of a sniffer trace when you use the DFU app on the phone or PC to perform a DFU update. You can use this sniffer trace as the reference to create your own DFU master.

    Take also a look at Appendix 1.5 in Hung's blogpost. He includes an example code for a very simple UART DFU master for nRF you can use as a reference.

    Best regards,

    Marjeris.

Children
Related