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

DFU error - Read no data from UART!

nrfutil dfu serial -pkg ble_app_v1.zip -p /dev/ttyUSB0 -b 57600 -fc 1

When activating DFU sometimes on the last packet sent to the bootloader, I see "Read no data from UART!"

It works sometimes without error, but other times only on the last packet it generates the error below:

Sending firmware file...
Selecting Object: type:2
Object selected:  max_size:4096 offset:0 crc:0x00000000
Streaming Data: len:4096 offset:0 crc:0x00000000
Streaming Data: len:4096 offset:4096 crc:0xEE809E11
Streaming Data: len:4096 offset:8192 crc:0xF1152A96
Streaming Data: len:4096 offset:12288 crc:0x593512DF
Streaming Data: len:4096 offset:16384 crc:0x6BCA54F6
Streaming Data: len:4096 offset:20480 crc:0xBDC1E7DF
Streaming Data: len:4096 offset:24576 crc:0x6956F910
Streaming Data: len:4096 offset:28672 crc:0x97F8D1AB
Streaming Data: len:4096 offset:32768 crc:0xF2803A78
Streaming Data: len:4096 offset:36864 crc:0x1C8CFAEA
Streaming Data: len:4096 offset:40960 crc:0x1FDBF3C1
Streaming Data: len:4096 offset:45056 crc:0x9F553CB7
Streaming Data: len:4096 offset:49152 crc:0xA9804943
Streaming Data: len:4096 offset:53248 crc:0x0A96A50F
Streaming Data: len:4096 offset:57344 crc:0x11BF809D
Streaming Data: len:4096 offset:61440 crc:0x80204A23
Streaming Data: len:4096 offset:65536 crc:0xAF1D7F35
Streaming Data: len:464 offset:69632 crc:0x0756822C
Read no data from UART!

Any ideas why the bootloader is not sending any response to the last packet in the DFU image?

nRF52832

SDK v15.3

S132 SoftDevice v6.1.1

PCA 10040

Parents
  • Hi, 

    Did you use the pca10040_uart_debug project? If so, did you modify the example?

    How do you generate the ble_app_v1.zip? What command did you use? What does the package include, app or SD+app?

    -Amanda H.

  • Application is:

    ble_app_uart_pca10040_s132

    where it goes into the bootloader in DFU mode

    Bootloader is:

    secure_bootloader_uart_mbr_pca10040_debug

    The problem is in the bootloader code, which is unmodified from the original.

    I generate the ble_app.zip with the following commands:

    For Application only:

    nrfutil pkg generate --application  nrf52832_xxaa.hex  --application-version 1  --application-version-string 1.0.0 --hw-version 52  --sd-req 0xB7 --key-file dfu_private_key.pem ble_app.zip

    For Application+SD+BL:

    nrfutil pkg generate --application  nrf52832_xxaa.hex  --application-version 1  --application-version-string 1.0.0 --hw-version 52  --softdevice sd.hex --sd-id 0xB7 --sd-req 0xB7 --bootloader bl.hex --bootloader-version 3 --key-file dfu_private_key.pem ble_app_sdbl.zip

    With these files I execute the dfu:

    nrfutil dfu serial -pkg ble_app.zip -p /dev/ttyUSB0 -b 57600 -fc 1

    The App+SD+BL would seem to work, but would always give me the Read no data from UART! error message after the last packet.

    The application only would always work, until recently, where it also now gives me the same error message after the last packet.

    This error message is generated by the nrfutil utility in uart_slip_receive() because it is waiting for a response from the bootloader that it never receives on the last undersized packet.

  • Hi, 

    I am sorry for the delay, The staffing is reduced during easter due to holidays and I will be gone this week, but I will be back Tuesday next week and will look at your ticket then.

    -Amanda H.

  • I was able to solve the issue.

    Here is what I observed and did:

    1) Looking at the bootloader debug logging during the DFU, I see that the 4096 byte packets have the following occur after the 4K packet is sent:

     Host requests CRC on the last 4K packet and bootloader sends 0x3 response:

    <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (data)

    <debug> nrf_dfu_req_handler: Offset:69632, CRC:0x0756822C

    <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1

    <debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]

    Then an OBJECT EXECUTE command is sent by the host and the bootloader immediately sends an 0x4 response:

    <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)

    <debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]

     

    2) The last packet sent is less than 4K. In my case it is 464 bytes. On this part of the process I see the following:

    Host requests CRC on the last 464 byte packet and bootloader sends 0x3 response:

    <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (data)

    <debug> nrf_dfu_req_handler: Offset:70096, CRC:0xA02E108B

    <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1

    <debug> nrf_dfu_serial: Sending Response: [0x3, 0x1]

    Then an OBJECT EXECUTE command is sent by the host but this time the bootloader does not immediately send the 0x4 response:

    <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)

    <debug> nrf_dfu_req_handler: Whole firmware image received. Postvalidating.

    <debug> nrf_dfu_validation: Hash verification. start address: 0x38000, size: 0x111D0

    <debug> nrf_dfu_validation: Invalidating old application in bank 0.

    <debug> nrf_dfu_serial: Sending Response: [0x4, 0x1]

     

    Conclusion:

    The host side (nrfutil) does not wait long enough for the 0x4 response to be sent. Therefore it thinks there was no response (only at the end of the image) and although everything is fine on the bootloader side, the host side (nrfutil) gives the error message "Read no data from UART!"

    I have ported the nrfutil code into firmware and I added an extra delay at this "end of image" special case and the 0x4 response is received now and the error message is no longer generated.

  • BTW

    Linux OS

    Ubuntu 16.04.6 LTS

    Application is:    ble_app_uart_pca10040_s132

    Bootloader is:    secure_bootloader_uart_mbr_pca10040_debug

Reply Children
No Data
Related