DFU over UART not working properly

Hello,

I am trying to update my Nordic nRF52840 via UART, using the bootloader from the examples (SDK 15.2.0). In the my application another MCU (from ST32) will update the Nordic, but to test the procedure I am trying to perform the update with nrfutil first.

So, after generating the signed .zip with the private key (of course I used the related public key to compile the bootloader) I run:

nrfutil.exe dfu serial -pkg out.zip -p COM12 -b 19200

and the output is:

2021-12-10 17:00:07,142 Using board at serial port: COM12
2021-12-10 17:00:07,148 Sending Application image.
2021-12-10 17:00:40,349 Serial: Set Packet Receipt Notification 0
2021-12-10 17:00:40,359 Sending init packet...
2021-12-10 17:00:40,359 Serial: Selecting Object: type:1
2021-12-10 17:00:40,370 Serial: Object selected: max_size:512 offset:141 crc:2892912021
2021-12-10 17:00:40,374 Sending firmware file...
2021-12-10 17:00:40,374 Serial: Selecting Object: type:2
2021-12-10 17:00:40,386 Serial: Object selected: max_size:4096 offset:5 crc:3209681985
2021-12-10 17:00:40,393 Serial: Streaming Data: len:4096 offset:0 crc:0x00000000
Traceback (most recent call last):
File "nordicsemi\dfu\dfu_transport_serial.py", line 123, in send_message
File "site-packages\serial\serialwin32.py", line 323, in write
serial.serialutil.SerialTimeoutException: Write timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "nordicsemi\__main__.py", line 1455, in <module>
File "site-packages\click\core.py", line 764, in __call__
File "site-packages\click\core.py", line 717, in main
File "site-packages\click\core.py", line 1137, in invoke
File "site-packages\click\core.py", line 1137, in invoke
File "site-packages\click\core.py", line 956, in invoke
File "site-packages\click\core.py", line 555, in invoke
File "nordicsemi\__main__.py", line 1035, in serial
File "nordicsemi\__main__.py", line 951, in do_serial
File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 301, in send_firmware
File "nordicsemi\dfu\dfu_transport_serial.py", line 466, in __stream_data
File "nordicsemi\dfu\dfu_transport_serial.py", line 125, in send_message
pc_ble_driver_py.exceptions.NordicSemiException: Writing to serial port failed: Write timeout. If MSD is enabled on the target device, try to disable it ref. wiki.segger.com/index.php
[7052] Failed to execute script __main__

I am also sniffing the TX and RX channels using an oscilloscope and UART decoding, with the result you see in the attached pic. It is clear that the communication starts and the Nordic answers (you can recognize it is SLIP protocol by the characteristic 0xc0 in the end of each message) but after a little (not shown in the pic) the communication stops.

I am sure I set the right baud rate (19200) on both ends (through the sdk_config parameter on Nordic, using the related parameter in nrfutil) and that I enabled the required UART interfaces for DFU. Plus I am not using hardware control, could this represent an issue for the UART DFU, even though I am working at a reduced speed? The error message is related to a "write timeout" and tells me to try to disable MSD (Mass storage control?), not sure what it means though. I am not using iOS (in another thread iOS was quoted as being related to the MSD issue).

Thanks for any help, I am really stuck on this!

Regards,

Stefano

Parents
  • my Nordic nRF52840

    Is this a custom board or a nRF52840DK?

    If it's a custom board, how is it connected to the DK?

    using the bootloader from the examples (SDK 15.2.0)

    I assume this one? \examples\dfu\secure_bootloader\pca10056_uart ?

    I am trying to perform the update with nrfutil first.

    What version of nrfutil? You can find it like this:

    C:\>nrfutil version
    nrfutil version 6.1.0

    What command did you use to generate the package?

    Write timeout. If MSD is enabled on the target device, try to disable it ref.

    You can disable the MSD of the kit by using the msddisable command in J-Link Commander. To enable, use the msdenable command. These commands take effect after a power cycle of the DK and stay this way until changed again.

  • Hello Sigurd, thanks for the reply.

    1) I have tried on both a nRF52840DK and on out custom board mounting a nRF52840. I managed to update the DK at 9600 bps with no hw control, while I cannot do the same with my custom board. I have used  nrfutil with the -vvvv option to get the SLIP packet content you can see the output in both cases at the end of the message, with some comments.

    2) Yes, I am using the secure bootloader example for the DK update. For the custom board I am using a slightly modified version (mainly in the sdk_config), since I would like to have uart and ble bootloader alltogether.

    3) I have just updated it to the latest version, 6.1.3 (it was 6.0.1 before). The command I use to generate the .zip file is:

    nrfutil pkg generate --hw-version 52 --sd-req 0xb6 --application-version 4 --key-file private.pem --application out.hex out.zip

    The zip file generated in this way works with the BLE DFU on the custom board and with the UART DFU on the DK 

    4) I did it (thanks!) and now the problem is different, see the message error at the end of the output below. Please also not my comments at the beginning of the custom board update output.

    UART DFU UPDATE ON NORDIC nRF52840DK:

    C:\work\nrfutil-6.1.3\nordicsemi>python __main__.py -vvvv dfu serial -fc 0 -prn 1 -pkg ../out.zip -p COM17 -b 9600
    2021-12-17 11:39:04,635 Using board at serial port: COM17
    2021-12-17 11:39:04,646 Sending Application image.
    2021-12-17 11:39:08,163 SLIP: --> [9, 1]
    2021-12-17 11:39:08,172 SLIP: <-- [96, 9, 1, 1]
    2021-12-17 11:39:08,172 Serial: Set Packet Receipt Notification 1
    2021-12-17 11:39:08,173 SLIP: --> [2, 1, 0]
    2021-12-17 11:39:08,182 SLIP: <-- [96, 2, 1]
    2021-12-17 11:39:08,182 SLIP: --> [7]
    2021-12-17 11:39:08,192 SLIP: <-- [96, 7, 1, 131, 0]
    2021-12-17 11:39:08,193 Sending init packet...
    2021-12-17 11:39:08,194 Serial: Selecting Object: type:1
    2021-12-17 11:39:08,201 SLIP: --> [6, 1]
    2021-12-17 11:39:08,222 SLIP: <-- [96, 6, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:08,222 Serial: Object selected: max_size:256 offset:0 crc:0
    2021-12-17 11:39:08,237 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 11:39:08,261 SLIP: <-- [96, 1, 1]
    2021-12-17 11:39:08,261 Serial: Streaming Data: len:141 offset:0 crc:0x00000000
    2021-12-17 11:39:08,262 SLIP: --> [8, 18, 138, 1, 10, 68, 8, 1, 18, 64, 8, 4, 16, 52, 26, 2, 182, 1, 32, 0, 40, 0, 48, 0, 56, 232, 219, 11, 66, 36, 8, 3, 18, 32, 133, 85, 98, 138, 101, 187, 125, 245, 14, 32, 6, 148, 43, 37, 142, 41, 34, 180, 196, 106, 184, 156, 168, 6, 57, 179, 205, 27, 18, 185, 250]
    2021-12-17 11:39:08,354 SLIP: <-- [96, 3, 1, 64, 0, 0, 0, 206, 10, 235, 161]
    2021-12-17 11:39:08,354 SLIP: --> [8, 147, 72, 0, 82, 4, 8, 1, 18, 0, 16, 0, 26, 64, 221, 209, 91, 86, 95, 68, 76, 117, 2, 28, 78, 255, 56, 140, 174, 243, 179, 222, 207, 88, 66, 74, 14, 109, 28, 249, 85, 141, 200, 61, 156, 154, 159, 107, 200, 93, 124, 79, 212, 170, 216, 133, 126, 128, 62, 140, 251, 140, 113, 55, 44]
    2021-12-17 11:39:08,446 SLIP: <-- [96, 3, 1, 128, 0, 0, 0, 42, 74, 206, 153]
    2021-12-17 11:39:08,446 SLIP: --> [8, 179, 207, 137, 151, 136, 24, 204, 70, 89, 121, 27, 241, 237]
    2021-12-17 11:39:08,479 SLIP: <-- [96, 3, 1, 141, 0, 0, 0, 203, 63, 102, 197]
    2021-12-17 11:39:08,479 SLIP: --> [3]
    2021-12-17 11:39:08,498 SLIP: <-- [96, 3, 1, 141, 0, 0, 0, 203, 63, 102, 197]
    2021-12-17 11:39:08,498 SLIP: --> [4]
    2021-12-17 11:39:08,703 SLIP: <-- [96, 4, 1]
    2021-12-17 11:39:08,703 Sending firmware file...
    2021-12-17 11:39:08,711 Serial: Selecting Object: type:2
    2021-12-17 11:39:08,711 SLIP: --> [6, 2]
    2021-12-17 11:39:08,733 SLIP: <-- [96, 6, 1, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:08,734 Serial: Object selected: max_size:4096 offset:0 crc:0
    2021-12-17 11:39:08,734 SLIP: --> [1, 2, 0, 16, 0, 0]
    2021-12-17 11:39:08,841 SLIP: <-- [96, 1, 1]
    2021-12-17 11:39:08,841 Serial: Streaming Data: len:4096 offset:0 crc:0x00000000
    2021-12-17 11:39:08,843 SLIP: --> [8, 0, 253, 3, 32, 53, 14, 4, 0, 93, 14, 4, 0, 95, 14, 4, 0, 97, 14, 4, 0, 99, 14, 4, 0, 101, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 14, 4, 0, 105, 14, 4, 0, 0, 0, 0, 0, 107, 14, 4, 0, 109, 14, 4, 0]
    2021-12-17 11:39:08,940 SLIP: <-- [96, 3, 1, 64, 0, 0, 0, 254, 175, 75, 42]
    2021-12-17 11:39:08,940 SLIP: --> [8, 111, 14, 4, 0, 111, 14, 4, 0, 53, 34, 4, 0, 77, 42, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 129, 32, 4, 0, 145, 37, 4, 0, 111, 14, 4, 0, 65, 39, 4, 0, 177, 201, 2, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0]
    2021-12-17 11:39:09,033 SLIP: <-- [96, 3, 1, 128, 0, 0, 0, 172, 83, 158, 207]
    2021-12-17 11:39:09,033 SLIP: --> [8, 111, 14, 4, 0, 33, 164, 3, 0, 105, 6, 3, 0, 41, 28, 4, 0, 241, 164, 3, 0, 111, 14, 4, 0, 253, 23, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 85, 39, 4, 0, 111, 14, 4, 0, 233, 36, 4, 0, 111, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:09,127 SLIP: <-- [96, 3, 1, 192, 0, 0, 0, 202, 141, 58, 88]
    2021-12-17 11:39:09,127 SLIP: --> [8, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 14, 4, 0, 0, 0, 0, 0, 111, 14, 4, 0]

    ...... update procedure ends successfully

    UART DFU UPDATE ON CUSTOM BOARD:

    Notice that max_size here is 512 instead of 256 from the DK update, I did not understand how to change this value and I am not sure whether this is related to the update failure. Notice also that:

    2021-12-17 13:10:55,410 SLIP: --> [1, 1, 141, 0, 0, 0]

    gets no answer from the Nordic, whereas in the DK update you get:

    2021-12-17 11:39:08,237 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 11:39:08,261 SLIP: <-- [96, 1, 1]

    Again, not sure if this has something to do with the problem nor what the missing packet means

    C:\work\nrfutil-6.1.3\nordicsemi>python __main__.py -vvvv dfu serial -fc 0 -prn 1 -pkg ../out.zip -p COM14 -b 9600
    2021-12-17 13:10:22,035 Using board at serial port: COM14
    2021-12-17 13:10:22,042 Sending Application image.
    2021-12-17 13:10:55,332 SLIP: --> [9, 1]
    2021-12-17 13:10:55,345 SLIP: <-- [96, 9, 1, 1]
    2021-12-17 13:10:55,345 Serial: Set Packet Receipt Notification 1
    2021-12-17 13:10:55,346 SLIP: --> [2, 1, 0]
    2021-12-17 13:10:55,361 SLIP: <-- [96, 2, 1]
    2021-12-17 13:10:55,361 SLIP: --> [7]
    2021-12-17 13:10:55,377 SLIP: <-- [96, 7, 1, 131, 0]
    2021-12-17 13:10:55,378 Sending init packet...
    2021-12-17 13:10:55,378 Serial: Selecting Object: type:1
    2021-12-17 13:10:55,388 SLIP: --> [6, 1]
    2021-12-17 13:10:55,409 SLIP: <-- [96, 6, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 13:10:55,409 Serial: Object selected: max_size:512 offset:0 crc:0
    2021-12-17 13:10:55,410 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 13:10:56,414 Serial: Streaming Data: len:141 offset:0 crc:0x00000000
    2021-12-17 13:10:56,414 SLIP: --> [8, 18, 138, 1, 10, 68, 8, 1, 18, 64, 8, 4, 16, 52, 26, 2, 182, 1, 32, 0, 40, 0, 48, 0, 56, 232, 219, 11, 66, 36, 8, 3, 18, 32, 133, 85, 98, 138, 101, 187, 125, 245, 14, 32, 6, 148, 43, 37, 142, 41, 34, 180, 196, 106, 184, 156, 168, 6, 57, 179, 205, 27, 18, 185, 250]
    Traceback (most recent call last):
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 1546, in <module>
    cli()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 1064, in serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 981, in do_serial
    dfu.dfu_send_images()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 255, in send_init_packet
    self.__stream_data(data=init_packet)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 472, in __stream_data
    response = self.__get_checksum_response()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 443, in __get_checksum_response
    (offset, crc) = struct.unpack('<II', bytearray(resp))
    TypeError: cannot convert 'NoneType' object to bytearray

     Many thanks.

    Regards,

    Stefano

Reply
  • Hello Sigurd, thanks for the reply.

    1) I have tried on both a nRF52840DK and on out custom board mounting a nRF52840. I managed to update the DK at 9600 bps with no hw control, while I cannot do the same with my custom board. I have used  nrfutil with the -vvvv option to get the SLIP packet content you can see the output in both cases at the end of the message, with some comments.

    2) Yes, I am using the secure bootloader example for the DK update. For the custom board I am using a slightly modified version (mainly in the sdk_config), since I would like to have uart and ble bootloader alltogether.

    3) I have just updated it to the latest version, 6.1.3 (it was 6.0.1 before). The command I use to generate the .zip file is:

    nrfutil pkg generate --hw-version 52 --sd-req 0xb6 --application-version 4 --key-file private.pem --application out.hex out.zip

    The zip file generated in this way works with the BLE DFU on the custom board and with the UART DFU on the DK 

    4) I did it (thanks!) and now the problem is different, see the message error at the end of the output below. Please also not my comments at the beginning of the custom board update output.

    UART DFU UPDATE ON NORDIC nRF52840DK:

    C:\work\nrfutil-6.1.3\nordicsemi>python __main__.py -vvvv dfu serial -fc 0 -prn 1 -pkg ../out.zip -p COM17 -b 9600
    2021-12-17 11:39:04,635 Using board at serial port: COM17
    2021-12-17 11:39:04,646 Sending Application image.
    2021-12-17 11:39:08,163 SLIP: --> [9, 1]
    2021-12-17 11:39:08,172 SLIP: <-- [96, 9, 1, 1]
    2021-12-17 11:39:08,172 Serial: Set Packet Receipt Notification 1
    2021-12-17 11:39:08,173 SLIP: --> [2, 1, 0]
    2021-12-17 11:39:08,182 SLIP: <-- [96, 2, 1]
    2021-12-17 11:39:08,182 SLIP: --> [7]
    2021-12-17 11:39:08,192 SLIP: <-- [96, 7, 1, 131, 0]
    2021-12-17 11:39:08,193 Sending init packet...
    2021-12-17 11:39:08,194 Serial: Selecting Object: type:1
    2021-12-17 11:39:08,201 SLIP: --> [6, 1]
    2021-12-17 11:39:08,222 SLIP: <-- [96, 6, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:08,222 Serial: Object selected: max_size:256 offset:0 crc:0
    2021-12-17 11:39:08,237 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 11:39:08,261 SLIP: <-- [96, 1, 1]
    2021-12-17 11:39:08,261 Serial: Streaming Data: len:141 offset:0 crc:0x00000000
    2021-12-17 11:39:08,262 SLIP: --> [8, 18, 138, 1, 10, 68, 8, 1, 18, 64, 8, 4, 16, 52, 26, 2, 182, 1, 32, 0, 40, 0, 48, 0, 56, 232, 219, 11, 66, 36, 8, 3, 18, 32, 133, 85, 98, 138, 101, 187, 125, 245, 14, 32, 6, 148, 43, 37, 142, 41, 34, 180, 196, 106, 184, 156, 168, 6, 57, 179, 205, 27, 18, 185, 250]
    2021-12-17 11:39:08,354 SLIP: <-- [96, 3, 1, 64, 0, 0, 0, 206, 10, 235, 161]
    2021-12-17 11:39:08,354 SLIP: --> [8, 147, 72, 0, 82, 4, 8, 1, 18, 0, 16, 0, 26, 64, 221, 209, 91, 86, 95, 68, 76, 117, 2, 28, 78, 255, 56, 140, 174, 243, 179, 222, 207, 88, 66, 74, 14, 109, 28, 249, 85, 141, 200, 61, 156, 154, 159, 107, 200, 93, 124, 79, 212, 170, 216, 133, 126, 128, 62, 140, 251, 140, 113, 55, 44]
    2021-12-17 11:39:08,446 SLIP: <-- [96, 3, 1, 128, 0, 0, 0, 42, 74, 206, 153]
    2021-12-17 11:39:08,446 SLIP: --> [8, 179, 207, 137, 151, 136, 24, 204, 70, 89, 121, 27, 241, 237]
    2021-12-17 11:39:08,479 SLIP: <-- [96, 3, 1, 141, 0, 0, 0, 203, 63, 102, 197]
    2021-12-17 11:39:08,479 SLIP: --> [3]
    2021-12-17 11:39:08,498 SLIP: <-- [96, 3, 1, 141, 0, 0, 0, 203, 63, 102, 197]
    2021-12-17 11:39:08,498 SLIP: --> [4]
    2021-12-17 11:39:08,703 SLIP: <-- [96, 4, 1]
    2021-12-17 11:39:08,703 Sending firmware file...
    2021-12-17 11:39:08,711 Serial: Selecting Object: type:2
    2021-12-17 11:39:08,711 SLIP: --> [6, 2]
    2021-12-17 11:39:08,733 SLIP: <-- [96, 6, 1, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:08,734 Serial: Object selected: max_size:4096 offset:0 crc:0
    2021-12-17 11:39:08,734 SLIP: --> [1, 2, 0, 16, 0, 0]
    2021-12-17 11:39:08,841 SLIP: <-- [96, 1, 1]
    2021-12-17 11:39:08,841 Serial: Streaming Data: len:4096 offset:0 crc:0x00000000
    2021-12-17 11:39:08,843 SLIP: --> [8, 0, 253, 3, 32, 53, 14, 4, 0, 93, 14, 4, 0, 95, 14, 4, 0, 97, 14, 4, 0, 99, 14, 4, 0, 101, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 14, 4, 0, 105, 14, 4, 0, 0, 0, 0, 0, 107, 14, 4, 0, 109, 14, 4, 0]
    2021-12-17 11:39:08,940 SLIP: <-- [96, 3, 1, 64, 0, 0, 0, 254, 175, 75, 42]
    2021-12-17 11:39:08,940 SLIP: --> [8, 111, 14, 4, 0, 111, 14, 4, 0, 53, 34, 4, 0, 77, 42, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 129, 32, 4, 0, 145, 37, 4, 0, 111, 14, 4, 0, 65, 39, 4, 0, 177, 201, 2, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0]
    2021-12-17 11:39:09,033 SLIP: <-- [96, 3, 1, 128, 0, 0, 0, 172, 83, 158, 207]
    2021-12-17 11:39:09,033 SLIP: --> [8, 111, 14, 4, 0, 33, 164, 3, 0, 105, 6, 3, 0, 41, 28, 4, 0, 241, 164, 3, 0, 111, 14, 4, 0, 253, 23, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 85, 39, 4, 0, 111, 14, 4, 0, 233, 36, 4, 0, 111, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 11:39:09,127 SLIP: <-- [96, 3, 1, 192, 0, 0, 0, 202, 141, 58, 88]
    2021-12-17 11:39:09,127 SLIP: --> [8, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 111, 14, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 14, 4, 0, 0, 0, 0, 0, 111, 14, 4, 0]

    ...... update procedure ends successfully

    UART DFU UPDATE ON CUSTOM BOARD:

    Notice that max_size here is 512 instead of 256 from the DK update, I did not understand how to change this value and I am not sure whether this is related to the update failure. Notice also that:

    2021-12-17 13:10:55,410 SLIP: --> [1, 1, 141, 0, 0, 0]

    gets no answer from the Nordic, whereas in the DK update you get:

    2021-12-17 11:39:08,237 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 11:39:08,261 SLIP: <-- [96, 1, 1]

    Again, not sure if this has something to do with the problem nor what the missing packet means

    C:\work\nrfutil-6.1.3\nordicsemi>python __main__.py -vvvv dfu serial -fc 0 -prn 1 -pkg ../out.zip -p COM14 -b 9600
    2021-12-17 13:10:22,035 Using board at serial port: COM14
    2021-12-17 13:10:22,042 Sending Application image.
    2021-12-17 13:10:55,332 SLIP: --> [9, 1]
    2021-12-17 13:10:55,345 SLIP: <-- [96, 9, 1, 1]
    2021-12-17 13:10:55,345 Serial: Set Packet Receipt Notification 1
    2021-12-17 13:10:55,346 SLIP: --> [2, 1, 0]
    2021-12-17 13:10:55,361 SLIP: <-- [96, 2, 1]
    2021-12-17 13:10:55,361 SLIP: --> [7]
    2021-12-17 13:10:55,377 SLIP: <-- [96, 7, 1, 131, 0]
    2021-12-17 13:10:55,378 Sending init packet...
    2021-12-17 13:10:55,378 Serial: Selecting Object: type:1
    2021-12-17 13:10:55,388 SLIP: --> [6, 1]
    2021-12-17 13:10:55,409 SLIP: <-- [96, 6, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2021-12-17 13:10:55,409 Serial: Object selected: max_size:512 offset:0 crc:0
    2021-12-17 13:10:55,410 SLIP: --> [1, 1, 141, 0, 0, 0]
    2021-12-17 13:10:56,414 Serial: Streaming Data: len:141 offset:0 crc:0x00000000
    2021-12-17 13:10:56,414 SLIP: --> [8, 18, 138, 1, 10, 68, 8, 1, 18, 64, 8, 4, 16, 52, 26, 2, 182, 1, 32, 0, 40, 0, 48, 0, 56, 232, 219, 11, 66, 36, 8, 3, 18, 32, 133, 85, 98, 138, 101, 187, 125, 245, 14, 32, 6, 148, 43, 37, 142, 41, 34, 180, 196, 106, 184, 156, 168, 6, 57, 179, 205, 27, 18, 185, 250]
    Traceback (most recent call last):
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 1546, in <module>
    cli()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 1064, in serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
    File "C:\work\nrfutil-6.1.3\nordicsemi\__main__.py", line 981, in do_serial
    dfu.dfu_send_images()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 255, in send_init_packet
    self.__stream_data(data=init_packet)
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 472, in __stream_data
    response = self.__get_checksum_response()
    File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 443, in __get_checksum_response
    (offset, crc) = struct.unpack('<II', bytearray(resp))
    TypeError: cannot convert 'NoneType' object to bytearray

     Many thanks.

    Regards,

    Stefano

Children
No Data
Related