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

dfu MESH NRF_ERROR_INVALID_DATA when changing application

Hello,

I have prepared an nRF52840 with DFU example (dfu_nrf52840_xxAA_s140_6_0_0).

When making the DFU package for the blinky example (bin/blinky/blinky_nrf52840_xxAA_s140_6.0.0.hex) the DFU process works correctly

When I prepare again the board and make a DFU package with my application, the DFU process failed and it says NRF_ERROR_INVALID_DATA 

nrfutil logs

nrfutil  --verbose dfu serial -pkg dfu_test.zip -i 500 -p COM26 -b 115200 -fc --mesh
Upgrading target on COM26 with DFU package C:\Nordic\nrf5_SDK_for_Mesh_v2.0.1_src\dfu_test.zip. Flow control is enabled.
Flushing com-port...
Opened com-port
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 239376
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: 1378fdff040f153d595559000000010003000000
target -> PC: 16a6045900000001000300000059000000010001000000
target -> PC: 03847800
PC -> target: 1378fdff040f153d595559000000010003000000
target -> PC: 03847800
PC -> target: 1478fcff0000153d5955ffffffffc4e9000000000c
target -> PC: 0ea30104590000000100030000000d
target -> PC: 03847800
Sending firmware file
  [------------------------------------]    1%  00:11:57PC -> target: 1978fcff0100153d595500f0032001610200316102005d580500
target -> PC: 03847887
PC -> target: 1978fcff0100153d595500f0032001610200316102005d580500
target -> PC: 03847887
PC -> target: 1978fcff0100153d595500f0032001610200316102005d580500
target -> PC: 03847887
PC -> target: 1978fcff0100153d595500f0032001610200316102005d580500
target -> PC: 03847887
PC -> target: 1978fcff0100153d595500f0032001610200316102005d580500
target -> PC: 03847887


Failed to upgrade target. Error is: Device returned status code ERROR_INVALID_DATA (135) on a DFU data packet.

Possible causes:
- bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
- baud rate or flow control is not the same as in the target bootloader.
- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.
Closing serial port...

This error is returned by nrf_mesh_dfu_rx() in serial_handler_openmesh_rx(). 

Do I have to make any changes to my application in ordre to be able to flash it using mesh DFU ?

I have read the related posts to this problem but so far, nothing really works

Parents
  • Update:

    I integrated the DFU mesh into my application.

    Making the dfu pakcage with blinky example (bin/blinky/blinky_nrf52840_xxAA_s140_6.0.0.hex), everything works correctly.

    When making the pakage with my application (new version), I get the following

    1- Without defining -i

    nrfutil --verbose dfu serial -pkg dfu_test.zip  -p COM26 -b 115200 -fc --mesh

    It always crashes

    PC -> target: 0502aabbccdd
    target -> PC: 0582aabbccdd
    Got echo response
    Sending DFU init packet
    PC -> target: 1378fdff040f9758a5a359000000010002000000
    target -> PC: 16a6045900000001000200000059000000010001000000
    target -> PC: 03847800
    PC -> target: 1378fdff040f9758a5a359000000010002000000
    target -> PC: 03847800
    PC -> target: 1478fcff00009758a5a3ffffffffd3e9000000000c
    PC -> target: 1478fcff00009758a5a3ffffffffd3e9000000000c
    PC -> target: 1478fcff00009758a5a3ffffffffd3e9000000000c
    PC -> target: 1478fcff00009758a5a3ffffffffd3e9000000000c
    PC -> target: 1478fcff00009758a5a3ffffffffd3e9000000000c
    
    
    Failed to upgrade target. Error is: Crashed on start packet

    I beleive the board is busy erasing the memory that's why nrfutil gets no response from the board as showed in the log above, I might be wrong but if it's the case, how can this be fixed ?

    2 - defining -i to 500

    nrfutil --verbose dfu serial -pkg dfu_test.zip -i 500  -p COM26 -b 115200 -fc --mesh

    If doesn't always work, sometimes I get 0x86 (SERIAL_STATUS_ERROR_BUSY) error but after few tries it work but the process take about 2 hours!

    3-defining -i  to 1000 : process always work (didn't continue to the end)

    what might cause this issue ? Have you tested this using a large application (hex file is 685 Kb) ?

     

  • If you are using the dual banked version, will the application fit ? (edited)

    I assume that you will need to store the entire application via DFU and also allow the currently running application to run so space needs will be at the maximum.

    Can you verify the space available.

Reply Children
Related