Production utility for flashing and key provisioning

We are using the nRF54L15 SoC with FOTA functionality. We have enabled secure FOTA by signing the firmware image and provisioning the public key into the SoC’s KMU. For production, we want to automate both the KMU key provisioning and flashing the firmware (hex/bin) onto the device using a script or PC-based command-line utility.

 

What is the recommended or best option to automate KMU key provisioning and firmware flashing for nRF54L15 in a production environment?

If we want to perform these steps from a PC via command line, do we need the full NCS toolchain and SDK installed, or is there a minimal toolset sufficient for production programming?

Parents Reply Children
  • We are currently using the following procedure to provision keys into the KMU of nRF54L15, and then flashing the firmware using the respective Python scripts.
    Could you please confirm whether this is the recommended approach, or if there is a better or more efficient method?

    Generate the private key used for firmware signing

    openssl genpkey -algorithm Ed25519 -out MANIFEST_APPLICATION_GEN1_priv.pem
    Generate the public key from the private key

    openssl pkey -in MANIFEST_APPLICATION_GEN1_priv.pem -pubout -out MANIFEST_APPLICATION_GEN1_pub.pem
    Generate the JSON file for the key to be provisioned
    python generate_psa_key_attributes.py --usage VERIFY_MESSAGE_EXPORT --id 0x7fff30e2 --type ECC_TWISTED_EDWARDS --size 255 --algorithm EDDSA_PURE --location LOCATION_CRACEN_KMU --key-from-file .\MANIFEST_APPLICATION_GEN1_pub.pem --file keys.json --lifetime PERSISTENCE_READ_ONLY
    Also, what exact does the "--id" parameter mean?
    Provision the key into the KMU
    nrfutil device x-provision-keys --key-file keys.json --traits jlink
    Program the firmware - 
    nrfutil device program --firmware ".\build\merged.hex" --traits jlink --options reset=RESET_DEFAULT,chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE,mcu_end_state=NRFDL_MCU_STATE_APPLICATION

  • Hi Darav, 
    The process looks fine to me. 
    Could you explain the id you used 0x7fff30e2.
    As far as I know when you program the key into KMU you simply select the slot you want to put the key to. See the documentation in the python file: 

        parser.add_argument(
            "--id",
            help="Key identifier (KMU slot number (0-255) for KMU keys)",
            type=lambda number_string: int(number_string, 0),
            required=True,
        )

Related