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

mesh serial DFU lost connection

"Failed to upgrade target. Error is: Lost connection in the middle of the transfer"

I am doing a mesh serial DFU with DFU quick start guide.

I have gotten all the way to step 10, performing the DFU. The DFU process keeps cutting out partway. Sometimes it gets to 2%, sometimes it doesn't get to 1%. I have checked on-chip debug logs (with DFU messages filtered in) and I see nothing helpful there. I need a lead to explore. Any suggestions?

A message tx from pc is not responded to and retransmitted, at which point error responses start. I have tried intervals from 20ms to 2000ms. 

B:\Devel\_LocalCopy\PCS_SERIAL 1.07 DFU\tools\dfu>nrfutil --verbose dfu serial -pkg dfu.zip -p COM9 -b 115200 -fc -i 20 --mesh
Upgrading target on COM9 with DFU package B:\Devel\_LocalCopy\PCS_SERIAL 1.07 DFU\tools\dfu\dfu.zip. Flow control is enabled.
[------------------------------------] 0%Flushing com-port...
Opened com-port
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 140868
Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
PC -> target: 0502aabbccdd
target -> PC: 0582aabbccdd
Got echo response
Sending DFU init packet
PC -> target: 1378fdff040fb48dd2f153435000010007000000
target -> PC: 16a6045343500001000700000053435000010001000000
target -> PC: 03847800
PC -> target: 1378fdff040fb48dd2f153435000010007000000
target -> PC: 03847800
PC -> target: 1478fcff0000b48dd2f1ffffffff9189000040000c
target -> PC: 0da2010453435000010007000000
target -> PC: 03847800
Sending firmware file
[------------------------------------] 1% 00:11:56PC -> target: 1978fcff0100b48dd2f100f00020356202006562020067620200
target -> PC: 03847800
PC -> target: 1978fcff0200b48dd2f1696202006b6202006d62020000000000
target -> PC: 03847800
PC -> target: 1978fcff0300b48dd2f10000000000000000000000006f620200
target -> PC: 03847800
PC -> target: 1978fcff0400b48dd2f171620200000000007362020075620200
target -> PC: 03847800
PC -> target: 1978fcff0500b48dd2f1796202007b620200a93c04007f620200
target -> PC: 03847800
PC -> target: 1978fcff0600b48dd2f181620200836202006186020087620200
target -> PC: 03847800
PC -> target: 1978fcff0700b48dd2f1896202008b620200618a03008f620200
target -> PC: 03847800
PC -> target: 1978fcff0800b48dd2f191620200936202009562020097620200
target -> PC: 03847800
PC -> target: 1978fcff0900b48dd2f199620200f1c0030029ce02009f620200
target -> PC: 03847800
PC -> target: 1978fcff0a00b48dd2f119c10300a362020091190400a7620200
target -> PC: 03847800
PC -> target: 1978fcff0b00b48dd2f1a9620200ab620200ad620200af620200
target -> PC: 03847800
PC -> target: 1978fcff0c00b48dd2f1b1620200b36202007762020077620200
target -> PC: 03847800
PC -> target: 1978fcff0d00b48dd2f1b5620200b7620200b9620200bb620200
target -> PC: 03847800
PC -> target: 1978fcff0e00b48dd2f1bd620200bf620200c162020035493648
target -> PC: 03847800
PC -> target: 1978fcff0f00b48dd2f10a1a02d0072291438d46344934480a1a
target -> PC: 03847800
PC -> target: 1978fcff1000b48dd2f106d00722914381f30988022282f31488
target -> PC: 03847800
PC -> target: 1978fcff1100b48dd2f130483149314a00f043f831483149324a
PC -> target: 1978fcff1100b48dd2f130483149314a00f043f831483149324a
target -> PC: 03847800
target -> PC: 03840084
PC -> target: 1978fcff1200b48dd2f100f03ef831483249324a00f039f83248
PC -> target: 1978fcff1200b48dd2f100f03ef831483249324a00f039f83248
PC -> target: 1978fcff1200b48dd2f100f03ef831483249324a00f039f83248
PC -> target: 1978fcff1200b48dd2f100f03ef831483249324a00f039f83248
PC -> target: 1978fcff1200b48dd2f100f03ef831483249324a00f039f83248


Failed to upgrade target. Error is: Lost connection in the middle of the transfer

Parents
  • Have you tried running the nrfutil command without the interval option (i.e. -i 20)? Does that also fail before the DFU completes?

    From experience, usually there is one small issue somewhere in the DFU quick start guide steps. If you have not created a script for this process, I would highly recommend doing this first. If that doesn't work, let me know & I'll take a closer look.

    Are you using a nRF52 DK as the serial device that communicates with the mesh network?

  • Good suggestions, but I already did both. I had many small issues with the DFU quick start guide, and scripts fixed some of them. I have also tried intervals of 500, 1000, and 2000.

    ...

    I figured it out! The flow control in my device is turned off and a byte is lost in transmission. Then the serial stream gets misaligned. I had to modify the nrfutil so that when it doesn't get a response, it flushes the target's buffer with 0x00 until it gets a response. It looks like this now (a snip from the middle of a TRX):

    target -> PC: 03847800
    PC -> target: 1978fcff11001adb8bda30483149314a00f043f831483149324a
    target -> PC: 03847800
    PC -> target: 1978fcff12001adb8bda00f03ef831483249324a00f039f83248
    target -> PC: 03847800
    PC -> target: 1978fcff13001adb8bda3249334a00f034f832483349334a00f0
    target -> PC: 03847800
    PC -> target: 1978fcff14001adb8bda2ff833483349344a00f02af833483449
    PC -> target: 0x00,  #0
    PC -> target: 0x00,  #1
    PC -> target: 0x00,  #2
    PC -> target: 0x00,  #3
    PC -> target: 0x00,  #4
    target -> PC: 03847800
    target -> PC: 03840084
    PC -> target: 1978fcff15001adb8bda344a00f025f834483449002200f02bf8
    target -> PC: 03847800
    PC -> target: 1978fcff16001adb8bda33483449002200f026f833483349091a
    target -> PC: 03847800
    PC -> target: 1978fcff17001adb8bda082903db00220260043001601f482049
    target -> PC: 03847800
    PC -> target: 1978fcff18001adb8bda884205d00268043003b4904703bcf7e7
    target -> PC: 03847800
    PC -> target: 1978fcff19001adb8bda00208646ec4600200021294a9047fee7
    target -> PC: 03847800
    PC -> target: 1978fcff1a001adb8bda884207d0521a05d0037801300b700131
    target -> PC: 03847800
    PC -> target: 1978fcff1b001adb8bda013af9d17047884202d002700130fae7
    PC -> target: 0x00,  #0
    PC -> target: 0x00,  #1
    PC -> target: 0x00,  #2
    PC -> target: 0x00,  #3
    PC -> target: 0x00,  #4
    PC -> target: 0x00,  #5
    PC -> target: 0x00,  #6
    PC -> target: 0x00,  #7
    PC -> target: 0x00,  #8
    PC -> target: 0x00,  #9
    PC -> target: 0x00,  #10
    PC -> target: 0x00,  #11
    PC -> target: 0x00,  #12
    PC -> target: 0x00,  #13
    PC -> target: 0x00,  #14
    PC -> target: 0x00,  #15
    PC -> target: 0x00,  #16
    PC -> target: 0x00,  #17
    PC -> target: 0x00,  #18
    PC -> target: 0x00,  #19
    target -> PC: 03847887
    PC -> target: 1978fcff1b001adb8bda013af9d17047884202d002700130fae7
    target -> PC: 03847800
    PC -> target: 1978fcff1c001adb8bda7047000000f0002000e8002000f00020
    target -> PC: 03847800
    PC -> target: 1978fcff1d001adb8bda00f00020c8840400c832002044340020
    target -> PC: 03847800

    It took about 12 minutes.

  • Glad to hear that you figured it out! The Mesh DFU can take a while if you are updating multiple mesh nodes at the same time, as the throughput is not that high.

  • Correction: it takes around 35 minutes to do a single upgrade, and not all devices succeed.

    It will be faster to just serial upgrade all devices at a faster interval. How can I turn off the mesh portion of the upgrade?

  • Very sorry for the late response. You can use nrf_mesh_dfu_jump_to_bootloader() to jump to the bootloader & run a bootloader mode DFU. The device will then not participate in the mesh network again until the DFU is successful (see link). More documentation is available here.

Reply Children
No Data
Related