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

How to do a frimware update which includes SD and app?


I tried to update SD + APP at the same time but it only uploads the SD. I create the zip file like this nrfutil pkg generate --hw-version 52 --application-version 1 --application app.hex --sd-req 0xC1 --sd-id 0xCA --softdevice s140_nrf52_7.0.1_softdevice.hex --key-file private.key app_dfu_package_softdevice.zipd. The problem is
when the SD is uploaded, the NRF52840 restarts and therefore the app cannot be loaded.

nrfutil dfu serial -pkg app_dfu_package_softdevice.zip -pCOM11
[#############################-------] 80% 00:01:06

If i look at the size of the packages the 80% that are done are the SD and the 20% are the Application. I use the usb Bootloader and and my Device-application is a usb cdc confic. 

  • Hi Streitler, 

    when performing a combined SD+ APP update, the DFU process will be done in two consecutive updates, where the nRF will reset in between.  This is stated under DFU package combinations

    4The SD (+ BL) + APP update is done with two consecutive connections, unless a custom bootloader is used. First the SD (+ BL) is updated, then the bootloader will disconnect and the (new) BL will start advertising. Then the second connection to the bootloader will update the APP.

    So the fact that the nRF52840 is resetting is expected, but the second transfer should start after the reset. Could you run nrfutil with maximum verbosity and log the output to a file using the -v and -o options, i.e. 

    nrfutil -vvvv dfu serial -pkg app_dfu_package_softdevice.zip -p COM11 -o nrfutil_logfile

    and then upload the nrfutil_logfile.log file?

    Best regars

    Bjørn

  • Hey Bjørn, 

    I messed it up with the output file but with nrfutil dfu serial there is no -o. I tried the command from you but it did not generate an output file is there another way to generate such a file?

    Greetings and thanks for the quick reply
    Lukas

  • Can you try to add -o after the -vvvv option? I think that should solve the issue with the no such option -o error

    nrfutil -vvvv  -o nrfutil_logfile dfu serial -pkg app_dfu_package_softdevice.zip -p COM11 -o nrfutil_logfile

  • so i did it and here is the output-file and i add the things what are not in the file: 

    Traceback (most recent call last):
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 198, in open
    self.serial_port = Serial(port=self.com_port,
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\serial\serialwin32.py", line 31, in __init__
    super(Serial, self).__init__(*args, **kwargs)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\serial\serialutil.py", line 240, in __init__
    self.open()
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\serial\serialwin32.py", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
    serial.serialutil.SerialException: could not open port 'COM11': FileNotFoundError(2, 'Das System kann die angegebene Datei nicht finden.', None, 2)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\stlu\AppData\Local\Programs\Python\Python38-32\Scripts\nrfutil-script.py", line 11, in <module>
    load_entry_point('nrfutil==6.0.1', 'console_scripts', 'nrfutil')()
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\__main__.py", line 1034, in serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\__main__.py", line 951, in do_serial
    dfu.dfu_send_images()
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
    File "c:\users\stlu\appdata\local\programs\python\python38-32\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 202, in open
    raise NordicSemiException("Serial port could not be opened on {0}"
    pc_ble_driver_py.exceptions.NordicSemiException: Serial port could not be opened on COM11. Reason: None

Related