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

bootloader DFU buttonless

I have developed hardware utilizing an nRF52832 and am developing a bootloader for the system. I have had success following two tutorials: Getting started with Nordic's Secure DFU bootloader, a step by step guide - Software Development Kit - Short-range guides - Nordic DevZone and https://github.com/gamnes/nRF52832-buttonless-dfu-development-tutorial. I have used both in an earlier version of SDK though these are both written for SDK 15. I am now trying to develop the process for SDK 17.0.2. I am close but nRFconnect has a problem with the Soft Device version. In the Nordic based tutorial there was information on the setting page where as the github does not describe this. So, the reason for the support is the Nordic tutorial will not stay open on my browser, but after a moment goes back to my home page Google. So, I can not look up the process to set the setting page to the version of the softdevice used. Any thoughts?

Parents
  • I have been following gamnes' tutorial located at github. The batch files utilize nrfutil to generate the hooks between an application and the bootloader. I have utilized the armgcc command line tool chain to program the dfu secure_bootloader pca10040_s132_ble_debug. The system can be identified on the PC through nRFconnect and connect to the USB dongle PCA10059 loads a fw.zip and begins to transfer, or validate, but the debug output, text included below, line 52 SD req not met.

    I have scrounged around the dev zone and found that the SD req for the s132_nrf52_7.2.0_softdevice.hex is 0x102 and 0x101 and edit this inside the batch file 03 inside gamnes's tutorial which creates the FW.zip with SD merged to app, and 03b without SD merged.

    echo "## Creating a FW.zip package that can be used to update the FW on the DK"
    nrfutil pkg generate --application app.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x102 --sd-id 0xA8 --softdevice s132_nrf52_7.2.0_softdevice.hex --key-file private.pem FW.zip
    echo.

    One thing to note is gamnes' 03 batch will not find s132_nrf52_6.0.0_softdevice.hex, when the batch file calls: 

    echo "## Creating a FW.zip package that can be used to update the FW on the DK"
    nrfutil pkg generate --application app.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x101 --sd-id 0xA8 --softdevice s132_nrf52_7.2.0_softdevice.hex --key-file private.pem FW.zip
    echo.

    I have set the S132=s132_nrf52_7.2.0_softdevice.hex within the batch, but I wonder if the nrfutil is the latetest version on my machine? 

    version 6.1.0

    1 "<debug> nrf_dfu_ble: Received BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST (request: 247, reply: 247)."
    2 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
    3 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    4 <debug> app: Shutting down transports (found: 1)
    5 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    6 <debug> app: timer_stop (0x20005974)
    7 <debug> app: timer_activate (0x20005974)
    8 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    9 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    10 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    11 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    12 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    13 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    14 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    15 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    16 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    17 <info> nrf_dfu_validation: Signature required. Checking signature.
    18 <info> nrf_dfu_validation: Calculating hash (len: 65)
    19 <info> nrf_dfu_validation: Verify signature
    20 <info> nrf_dfu_validation: Image verified
    21 <warning> nrf_dfu_ver_validation: SD req not met.
    22 <warning> nrf_dfu_validation: Prevalidation failed.
    23 <debug> nrf_dfu_validation: Init command:
    24 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    25 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    26 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    27 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    28 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    29 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    30 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    31 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    32 <debug> nrf_dfu_validation: 00 |.
    33 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    34 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    35 <debug> app: Shutting down transports (found: 1)
    36 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    37 <debug> app: timer_stop (0x20005974)
    38 <debug> app: timer_activate (0x20005974)
    39 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    40 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    41 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    42 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    43 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    44 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    45 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    46 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    47 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    48 <info> nrf_dfu_validation: Signature required. Checking signature.
    49 <info> nrf_dfu_validation: Calculating hash (len: 65)
    50 <info> nrf_dfu_validation: Verify signature
    51 <info> nrf_dfu_validation: Image verified
    52 <warning> nrf_dfu_ver_validation: SD req not met.
    53 <warning> nrf_dfu_validation: Prevalidation failed.
    54 <debug> nrf_dfu_validation: Init command:
    55 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    56 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    57 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    58 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    59 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    60 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    61 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    62 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    63 <debug> nrf_dfu_validation: 00 |.
    64 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    65 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    66 <debug> app: Shutting down transports (found: 1)
    67 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    68 <debug> app: timer_stop (0x20005974)
    69 <debug> app: timer_activate (0x20005974)
    70 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    71 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    72 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    73 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    74 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    75 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    76 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    77 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    78 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    79 <info> nrf_dfu_validation: Signature required. Checking signature.
    80 <info> nrf_dfu_validation: Calculating hash (len: 65)
    81 <info> nrf_dfu_validation: Verify signature
    82 <info> nrf_dfu_validation: Image verified
    83 <warning> nrf_dfu_ver_validation: SD req not met.
    84 <warning> nrf_dfu_validation: Prevalidation failed.
    85 <debug> nrf_dfu_validation: Init command:
    86 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    87 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    88 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    89 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    90 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    91 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    92 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    93 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    94 <debug> nrf_dfu_validation: 00 |.
    95 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    96 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    97 <debug> nrf_dfu_ble: Advertising...
    98 <debug> nrf_dfu_settings: Using settings page.
    99 <debug> nrf_dfu_settings: Copying forbidden parts from backup page.

Reply
  • I have been following gamnes' tutorial located at github. The batch files utilize nrfutil to generate the hooks between an application and the bootloader. I have utilized the armgcc command line tool chain to program the dfu secure_bootloader pca10040_s132_ble_debug. The system can be identified on the PC through nRFconnect and connect to the USB dongle PCA10059 loads a fw.zip and begins to transfer, or validate, but the debug output, text included below, line 52 SD req not met.

    I have scrounged around the dev zone and found that the SD req for the s132_nrf52_7.2.0_softdevice.hex is 0x102 and 0x101 and edit this inside the batch file 03 inside gamnes's tutorial which creates the FW.zip with SD merged to app, and 03b without SD merged.

    echo "## Creating a FW.zip package that can be used to update the FW on the DK"
    nrfutil pkg generate --application app.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x102 --sd-id 0xA8 --softdevice s132_nrf52_7.2.0_softdevice.hex --key-file private.pem FW.zip
    echo.

    One thing to note is gamnes' 03 batch will not find s132_nrf52_6.0.0_softdevice.hex, when the batch file calls: 

    echo "## Creating a FW.zip package that can be used to update the FW on the DK"
    nrfutil pkg generate --application app.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0x101 --sd-id 0xA8 --softdevice s132_nrf52_7.2.0_softdevice.hex --key-file private.pem FW.zip
    echo.

    I have set the S132=s132_nrf52_7.2.0_softdevice.hex within the batch, but I wonder if the nrfutil is the latetest version on my machine? 

    version 6.1.0

    1 "<debug> nrf_dfu_ble: Received BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST (request: 247, reply: 247)."
    2 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
    3 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    4 <debug> app: Shutting down transports (found: 1)
    5 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    6 <debug> app: timer_stop (0x20005974)
    7 <debug> app: timer_activate (0x20005974)
    8 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    9 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    10 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    11 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    12 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    13 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    14 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    15 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    16 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    17 <info> nrf_dfu_validation: Signature required. Checking signature.
    18 <info> nrf_dfu_validation: Calculating hash (len: 65)
    19 <info> nrf_dfu_validation: Verify signature
    20 <info> nrf_dfu_validation: Image verified
    21 <warning> nrf_dfu_ver_validation: SD req not met.
    22 <warning> nrf_dfu_validation: Prevalidation failed.
    23 <debug> nrf_dfu_validation: Init command:
    24 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    25 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    26 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    27 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    28 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    29 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    30 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    31 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    32 <debug> nrf_dfu_validation: 00 |.
    33 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    34 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    35 <debug> app: Shutting down transports (found: 1)
    36 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    37 <debug> app: timer_stop (0x20005974)
    38 <debug> app: timer_activate (0x20005974)
    39 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    40 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    41 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    42 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    43 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    44 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    45 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    46 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    47 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    48 <info> nrf_dfu_validation: Signature required. Checking signature.
    49 <info> nrf_dfu_validation: Calculating hash (len: 65)
    50 <info> nrf_dfu_validation: Verify signature
    51 <info> nrf_dfu_validation: Image verified
    52 <warning> nrf_dfu_ver_validation: SD req not met.
    53 <warning> nrf_dfu_validation: Prevalidation failed.
    54 <debug> nrf_dfu_validation: Init command:
    55 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    56 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    57 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    58 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    59 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    60 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    61 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    62 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    63 <debug> nrf_dfu_validation: 00 |.
    64 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    65 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    66 <debug> app: Shutting down transports (found: 1)
    67 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
    68 <debug> app: timer_stop (0x20005974)
    69 <debug> app: timer_activate (0x20005974)
    70 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    71 "<debug> nrf_dfu_ble: Buffer 0x20008298 acquired, len 142 (244)"
    72 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
    73 <debug> nrf_dfu_ble: Freeing buffer 0x20008298
    74 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    75 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
    76 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
    77 <debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
    78 <debug> nrf_dfu_validation: PB: Init packet data len: 65
    79 <info> nrf_dfu_validation: Signature required. Checking signature.
    80 <info> nrf_dfu_validation: Calculating hash (len: 65)
    81 <info> nrf_dfu_validation: Verify signature
    82 <info> nrf_dfu_validation: Image verified
    83 <warning> nrf_dfu_ver_validation: SD req not met.
    84 <warning> nrf_dfu_validation: Prevalidation failed.
    85 <debug> nrf_dfu_validation: Init command:
    86 <debug> nrf_dfu_validation: 08 90 4E 10 34 1A 02 A8|..N.4...
    87 <debug> nrf_dfu_validation: 01 20 00 28 00 30 00 38|. .(.0.8
    88 <debug> nrf_dfu_validation: C4 99 03 42 24 08 03 12|...B$...
    89 <debug> nrf_dfu_validation: 20 08 0C 31 EC 48 5A D8| ..1.HZ.
    90 <debug> nrf_dfu_validation: B0 CE A7 96 C2 35 F9 23|.....5.#
    91 <debug> nrf_dfu_validation: 3E 96 F0 41 9E 3D 36 02|>..A.=6.
    92 <debug> nrf_dfu_validation: 97 92 FF 14 77 FD BC 8F|....w...
    93 <debug> nrf_dfu_validation: C5 48 00 52 04 08 01 12|.H.R....
    94 <debug> nrf_dfu_validation: 00 |.
    95 <debug> nrf_dfu_req_handler: Request handling complete. Result: 0xB
    96 <warning> nrf_dfu_ble: DFU request 4 failed with error: 0xB
    97 <debug> nrf_dfu_ble: Advertising...
    98 <debug> nrf_dfu_settings: Using settings page.
    99 <debug> nrf_dfu_settings: Copying forbidden parts from backup page.

Children
No Data
Related