Automating Nordic Secure Bootloader FW Signing

Sysprogs forums Forums VisualGDB Automating Nordic Secure Bootloader FW Signing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27879
    grindstaffp
    Participant

    I am working on an application using the Nordic BSP (v16) that I’ve recently implemented the secure bootloader in. When using the secure bootloader it is necessary to generate a setting page that needs to be flashed to the device in addition to the firmware. Generating this page file is done by calling nrfutil and looks similar to the below command:

    nrfutil settings generate --family NRF52840 --application client\pca10056\blank\armgcc\_build\nrf52840_xxaa.hex --application-version 0x01010101 --bootloader-version 1 --bl-settings-version 2 --app-boot-validation VALIDATE_ECDSA_P256_SHA256 --key-file priv.pem settings.hex

    The settings page can optionally be merged with the firmware hex to be flashed in one pass.

    mergehex -m client\pca10056\blank\armgcc\_build\nrf52840_xxaa.hex settings.hex -o dfu_client.hex

    Is this something that could be automated either by utilizing custom build steps or some other mechanism in the build and flash process? It would be nice to have the ability to modify the application version perhaps by user input, but manually editing wouldn’t be too bad (maybe a define in the project?)

    Thanks.

    #27886
    support
    Keymaster

    Yes, you can simply add those commands to VisualGDB Project Properties -> Custom Debug Steps -> Before Launching Debugger.

    You may also want to disable the regular FLASH programming command via VisualGDB Project Properties -> Debug Settings (as it would program the regular image) and either program the .hex file by running a command-line programming tool, or add a Segger-specific monitor command that would program the .hex file to the Additional GDB Commands page (see J-Link documentation for the list of the monitor commands supported by J-Link).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.