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

If first DFU fails, the app is broken

Hi,

I have a problem when i try a dfu on my device for the first time.

To explain, my device is flashed the first time with NRFJPROG, and i flash the SD+BOOT+APP.

So my device is working well.

Then i when to upload the firmware, so i realize a dfu.

It's a dual bank bootloader.

If the dfu fails for somehow reason, my device is broken, the app does not started, and the device is not advertising.

But only if it's the first time we try. If the first try succeed, the app start like expected.

Then if we try a 2nd DFU and that fail, the device start the previous application stored.

I think my application is still present, because i saw it with nrf connect once the device is broken.

It seems the bootloader does not have the start address of the application.

For the moment i'm blocked here, and I hope you could help me.

My device is a NRF52832, and i work withe SD 132_6.1.0

Thanks,

Parents Reply Children
  • In fact, nothing cause the fail.

    To explain more, the dfu is realized by an other nrf52 device. It's a central ble who update the peripheral.

    The process is a bit long (around 1min30) and the two device could be moving. So a loss of connection is possible during an update.

    And for me during an single-bank update, the application is not preserved, if I read your link, if we fail the update, we restart in bootloader without application. It's for that we use a dual-bank update.

    The dual-bank update work well except for the first dfu, if I cause an error intentionally, the device restart the bootloader, but it's broke then.

    I make the cmd "nrfjprog --readregs" to know where the device is blocked.

    And i have this answer 

    R0:   0xFFFFFFFF
    R1:   0xFFFFFFFF
    R2:   0x00024D39
    R3:   0x00026000
    R4:   0x00001000
    R5:   0x20001378
    R6:   0x00024D39
    R7:   0x00000000
    R8:   0xFFFFFFFF
    R9:   0x00000000
    R10:  0x00000000
    R11:  0x00000000
    R12:  0x40000614
    SP:   0x20001378
    LR:   0xFFFFFFFF
    PC:   0x00024D36
    xPSR: 0x61000000
    MSP:  0x20001378
    PSP:  0x00000000

    So for me the device is blocked in the sofdevice.

    Julien f

  • Hi, 

    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.

  • Hi,

    Julien said:
    if I cause an error intentionally, the device restart the bootloader, but it's broke then.

    How did you cause an error? Could you provide the detail? 

    -Amanda H.

  • To cause an error, i just switched off my central during the DFU process 

  • He seems to me that we we don't understand each other.

    So my problem is not the dfu fails, is why when the dfu fail my device doesn't restart the application.

    For me it's important because my two device could be moving during the process and i need to be sure if a loss connection occurs my peripheral is not broken.

    For the test, i simply switched off my central to fails the dfu, but it's just for the example.

    If my peripheral is only programming by nrfjprog and none dfu has occur on him before, my peripheral doesn't start again, and after readed the register i look the "PC" register i saw the device is blocked at the address 0x00024D36, an address of the softdevice.

    But i simply switched off my central during a dfu of a peripheral who a dfu has already occur before. The application start after the fail.

    So my question is why we have two behaviour.

    It seems like something is not set on the first time. In debugging, i see after an error of dfu, the dfu settings changed. The bank current change but for the first behaviour nothing is set.

    I show you the different state of the dfu settings struct

    Init state, the device is only flash by nrfjprog, we haven't try to make a dfu :  

    First try of dfu, dfu fails, the app never start after the fail : 

    And a dfu has already success on the peripheral, but a 2nd dfu fail, the app restart after the fail : 

    Do you think my problem come from here?

    Thanks

Related