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

Have to run DFU OTA twice

Hi, I know there are already lots of threads around this but it seems none is like mine.

I'm running my toolchain on a Mac so I think I have a more challenging debug setup as I never found out how I can get RTT logger to log the normal app and still continue logging during DFU. However, this is the end of the DFU log:

<info> dfu_req_handling: Doing postvalidate
<info> dfu_req_handling: Current bank is bank 1
<info> dfu_req_handling: Running SD version check ============== 
<info> dfu_req_handling: Successfully ran the postvalidation check!
<info> dfu_req_handling: Invalidating old application in bank 0.
<debug> nrf_dfu_settings: Writing settings...
<debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
<debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 3
<debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 4
<debug> app: Sending Response: [0x4, 0x1]
<debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 3
<debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 2
<debug> dfu_req_handling: Response sent.
<debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 1
<debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
<debug> nrf_dfu_flash: This operation had a callback, calling back to 0x00073445.
<debug> dfu_req_handling: All flash operations have completed.
<debug> dfu_req_handling: Starting reset timer.
<debug> dfu_req_handling: Attempting to reset the device.
<debug> app: In nrf_dfu_transports_close
<debug> app: num transports: 1
<debug> app: Shutting down BLE transport.
<debug> app: Disconnecting.
<debug> app: BLE transport shut down.
<debug> app: After nrf_dfu_transports_init
<debug> dfu_req_handling: Reset.

After that, I restart the logger to get my application log, and it still shows the old version.

As the log shows that it is actually marking the new bank as primary, I really don't know how to proceed with debugging

Parents
  • My testing is set up as follows:

    • flash the initial bootloader + sd + app + bl settings via nrfjprog
    • generate a package (debug) with only the app via nrfutil pkg generate --application-version 3 --application app.hex --hw-version 52 --sd-req 0x9D --debug-mode --key-file private.pem package.zip

    And here's the nrfutil settings display output:

    After initial flash

    Family:               nRF52
    CRC:                  0x9600BC1B
    Settings Version:     0x00000001 (1)
    App Version:          0x00000003 (3)
    Bootloader Version:   0x00000002 (2)
    Bank Layout:          0x00000000
    Current Bank:         0x00000000
    Application Size:     0x00015F34 (89908 bytes)
    Application CRC:      0x42280D65
    Bank0 Bank Code:      0x00000001
    

    ** After OTA dfu (secure ble w/o bonding) **

    Bootloader DFU Settings:
    File:                 temp.hex
    Family:               nRF52
    CRC:                  0x40FB9CB2
    Settings Version:     0x00000001 (1)
    App Version:          0x00000003 (3)
    Bootloader Version:   0x00000002 (2)
    Bank Layout:          0x00000000
    Current Bank:         0x00000001
    Application Size:     0x00015F34 (89908 bytes)
    Application CRC:      0x42280D65
    Bank0 Bank Code:      0x00000000
    

    it looks like the bank was switched, but the application is still the same, right?

    Thanks for the hint about logging!

Reply
  • My testing is set up as follows:

    • flash the initial bootloader + sd + app + bl settings via nrfjprog
    • generate a package (debug) with only the app via nrfutil pkg generate --application-version 3 --application app.hex --hw-version 52 --sd-req 0x9D --debug-mode --key-file private.pem package.zip

    And here's the nrfutil settings display output:

    After initial flash

    Family:               nRF52
    CRC:                  0x9600BC1B
    Settings Version:     0x00000001 (1)
    App Version:          0x00000003 (3)
    Bootloader Version:   0x00000002 (2)
    Bank Layout:          0x00000000
    Current Bank:         0x00000000
    Application Size:     0x00015F34 (89908 bytes)
    Application CRC:      0x42280D65
    Bank0 Bank Code:      0x00000001
    

    ** After OTA dfu (secure ble w/o bonding) **

    Bootloader DFU Settings:
    File:                 temp.hex
    Family:               nRF52
    CRC:                  0x40FB9CB2
    Settings Version:     0x00000001 (1)
    App Version:          0x00000003 (3)
    Bootloader Version:   0x00000002 (2)
    Bank Layout:          0x00000000
    Current Bank:         0x00000001
    Application Size:     0x00015F34 (89908 bytes)
    Application CRC:      0x42280D65
    Bank0 Bank Code:      0x00000000
    

    it looks like the bank was switched, but the application is still the same, right?

    Thanks for the hint about logging!

Children
No Data
Related