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

first DFU test failed to pre-validate

SDK 12.3, pca10040 and armgcc

Built bootloader_secure (debug version) and flashed it.

Loading appears to take place but nothing showing on RTT console afterwards.

Then flashed it again. Appeared to flash OK this time.

Now the RTT viewer shows:

:INFO:Inside main
:INFO:In nrf_bootloader_init
:INFO:In real nrf_dfu_init
:INFO:running nrf_dfu_settings_init
:INFO:Enter nrf_dfu_continue
:INFO:Single: Invalid bank
:INFO:Enter nrf_dfu_app_is_valid
:INFO:Return false in valid app check
:INFO:In nrf_dfu_transports_init
:INFO:num transports: 1
:INFO:vector table: 0x00075000
SDH:WARNING:sd_ble_enable: RAM start should be adjusted to 0x20002798
SDH:WARNING:RAM size should be adjusted to 0xd868 
:INFO:Waiting for events

If I hit reset button I get the above again.

Fired up nRF Toolbox on Android 7.0

Selected zip file dfu_test_app_hrm_s132 (from SDK 12.2)

Console says:

:INFO:Received select object
:INFO:Valid Command: NRF_DFU_OBJECT_OP_SELECT
:INFO:Sending Object Info: [0x60, 0x06, 0x01 max: 0:x00000100 0:x00000000, CRC:0x00000000]
:INFO:Set receipt notif
:INFO:Sending Response: [0x2, 0x1]
:INFO:Received create object
:INFO:Before OP create command
:INFO:Valid Command Create
:INFO:Sending Response: [0x1, 0x1]
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Before OP write command
:INFO:Received calculate CRC
:INFO:Valid Command CRC
:INFO:Sending CRC: [0x60, 0x03, 0x01, 0:x0000008a, CRC:0xad48567a]
:INFO:Received execute object
:INFO:Before OP execute command
:INFO:Valid command execute
:INFO:
12 87 01 0A 41 08 01 12 3D 08 01 10 34 1A 05 8C  ....A...=...4...
01 FE 95 03 20 00 28 00 30 00 38 B8 F8 01 42 24  .... .(.0.8...B$
08 03 12 20 EC 6D 22 99 8F D9 84 C8 2A 26 3D DE  ... .m".....*&=.
C0 E4 EE F1 43 51 85 FD FE 0B 96 8F 62 2B 07 D8  ....CQ......b+..
56 EF CE 07 48 01 10 00 1A 40 A5 3E 6B 02 29 8A  V...H....@.>k.).
A5 35 D8 39 C8 70 53 E8 72 A5 A1 B1 E8 D4 40 8C  .5.9.pS.r.....@.
:INFO:
:INFO:Prevalidate FAILED!
:INFO:Sending Response: [0x4, 0x5]

Repeated the last steps. Same effect.

Could this be because I tried to use the pre-built .zip file from SDK 12.2? (I have not touched any key pairs yet.)

Now I was not able to go back to flashing my examples in the usual way (via J-Link). This problem went away after I did

 nrfjprog -f nrf52 -e
Parents
  • Tried again after generating a new package.zip

    nrfutil pkg generate --debug-mode --application _build/nrf52832_xxaa.hex --key-file ../../../keys/priv.pem myapp_dfu_package.zip
    

    different results but the DFU failed:

    :INFO:Inside main of bootloader_secure
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:!!!!!!!!!!!!!!! Resetting bootloader settings !!!!!!!!!!!
    :INFO:Erasing old settings at: 0x0007f000
    :INFO:Erasing: 0x0007f000, num: 1
    :INFO:Writing 0x00000057 words
    :INFO:Writing settings...
    :INFO:Enter nrf_dfu_continue
    :INFO:Single: Invalid bank
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return false in valid app check
    :INFO:In nrf_dfu_transports_init
    :INFO:Inside main of bootloader_secure
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:Enter nrf_dfu_continue
    :INFO:Single: Invalid bank
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return false in valid app check
    :INFO:In nrf_dfu_transports_init
    :INFO:num transports: 1
    :INFO:vector table: 0x00075000
    SDH:WARNING:sd_ble_enable: RAM start should be adjusted to 0x20002798
    SDH:WARNING:RAM size should be adjusted to 0xd868 
    :INFO:After nrf_dfu_transports_init
    :INFO:------- nrf_dfu_flash_init-------
    :INFO:Waiting for events
    

    So I still have warnings that I don't know how to fix. Then I try the DFU:

    :INFO:Received select object
    :INFO:Valid Command: NRF_DFU_OBJECT_OP_SELECT
    :INFO:Sending Object Info: [0x60, 0x06, 0x01 max: 0:x00000100 0:x00000000, CRC:0x00000000]
    :INFO:Set receipt notif
    :INFO:Sending Response: [0x2, 0x1]
    :INFO:Received create object
    :INFO:Before OP create command
    :INFO:Valid Command Create
    :INFO:Sending Response: [0x1, 0x1]
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Received calculate CRC
    :INFO:Valid Command CRC
    :INFO:Sending CRC: [0x60, 0x03, 0x01, 0:x00000090, CRC:0x0841078f]
    :INFO:Received execute object
    :INFO:Before OP execute command
    :INFO:Valid command execute
    :INFO:
    12 8D 01 0A 47 08 01 12 43 08 FF FF FF FF 0F 10  ....G...C.......
    FF FF FF FF 0F 1A 03 FE FF 03 20 00 28 00 30 00  .......... .(.0.
    38 D0 BD 01 42 24 08 03 12 20 C2 8A 2A C6 60 8E  8...B$... ..*.`.
    87 8F 49 3D 26 E0 8F B9 E6 AB 61 B7 17 99 22 C7  ..I=&.....a...".
    97 39 73 4D D0 24 7A 5D 32 1A 48 01 10 00 1A 40  .9sM.$z]2.H....@
    D4 E1 40 93 2F A1 90 93 27 D3 40 E4 AE 8E 82 69  ..@./...'[email protected]
    :INFO:
    :INFO:Prevalidate FAILED!
    :INFO:Sending Response: [0x4, 0x5]
    

    So the end result is the same.

Reply
  • Tried again after generating a new package.zip

    nrfutil pkg generate --debug-mode --application _build/nrf52832_xxaa.hex --key-file ../../../keys/priv.pem myapp_dfu_package.zip
    

    different results but the DFU failed:

    :INFO:Inside main of bootloader_secure
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:!!!!!!!!!!!!!!! Resetting bootloader settings !!!!!!!!!!!
    :INFO:Erasing old settings at: 0x0007f000
    :INFO:Erasing: 0x0007f000, num: 1
    :INFO:Writing 0x00000057 words
    :INFO:Writing settings...
    :INFO:Enter nrf_dfu_continue
    :INFO:Single: Invalid bank
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return false in valid app check
    :INFO:In nrf_dfu_transports_init
    :INFO:Inside main of bootloader_secure
    :INFO:In nrf_bootloader_init
    :INFO:In real nrf_dfu_init
    :INFO:running nrf_dfu_settings_init
    :INFO:Enter nrf_dfu_continue
    :INFO:Single: Invalid bank
    :INFO:Enter nrf_dfu_app_is_valid
    :INFO:Return false in valid app check
    :INFO:In nrf_dfu_transports_init
    :INFO:num transports: 1
    :INFO:vector table: 0x00075000
    SDH:WARNING:sd_ble_enable: RAM start should be adjusted to 0x20002798
    SDH:WARNING:RAM size should be adjusted to 0xd868 
    :INFO:After nrf_dfu_transports_init
    :INFO:------- nrf_dfu_flash_init-------
    :INFO:Waiting for events
    

    So I still have warnings that I don't know how to fix. Then I try the DFU:

    :INFO:Received select object
    :INFO:Valid Command: NRF_DFU_OBJECT_OP_SELECT
    :INFO:Sending Object Info: [0x60, 0x06, 0x01 max: 0:x00000100 0:x00000000, CRC:0x00000000]
    :INFO:Set receipt notif
    :INFO:Sending Response: [0x2, 0x1]
    :INFO:Received create object
    :INFO:Before OP create command
    :INFO:Valid Command Create
    :INFO:Sending Response: [0x1, 0x1]
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Before OP write command
    :INFO:Received calculate CRC
    :INFO:Valid Command CRC
    :INFO:Sending CRC: [0x60, 0x03, 0x01, 0:x00000090, CRC:0x0841078f]
    :INFO:Received execute object
    :INFO:Before OP execute command
    :INFO:Valid command execute
    :INFO:
    12 8D 01 0A 47 08 01 12 43 08 FF FF FF FF 0F 10  ....G...C.......
    FF FF FF FF 0F 1A 03 FE FF 03 20 00 28 00 30 00  .......... .(.0.
    38 D0 BD 01 42 24 08 03 12 20 C2 8A 2A C6 60 8E  8...B$... ..*.`.
    87 8F 49 3D 26 E0 8F B9 E6 AB 61 B7 17 99 22 C7  ..I=&.....a...".
    97 39 73 4D D0 24 7A 5D 32 1A 48 01 10 00 1A 40  .9sM.$z]2.H....@
    D4 E1 40 93 2F A1 90 93 27 D3 40 E4 AE 8E 82 69  ..@./...'[email protected]
    :INFO:
    :INFO:Prevalidate FAILED!
    :INFO:Sending Response: [0x4, 0x5]
    

    So the end result is the same.

Children
No Data
Related