Working with SEC - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki

MCUXpresso Secure Provisioning Tool (SEC) is a tool made to simplify the generation and provisioning of bootable executables on NXP MCU platforms. It also offers a command-line interface, enabling integration in automated environments or customization of image building/burning procedure.

Starting with MCUXpresso for VS Code 1.10, SEC features are used to generate bootable executables for the RT1180 target for which otherwise the bootable executable is not available.

For the integration between MCUXpresso for VS Code extension and SEC to work properly, the user must first use MCUXpresso Installer to install SEC.

RT118x

The integration with SEC is available now for RT118x targets, the flexspi_nor_debug and flexspi_nor_release build configurations. When using these configurations, after building the RT1180 project, the MCUXpresso extension will invoke SEC to generate bootable executable for the project.

Corresponding messages will appear to make the user aware of the still in progress actions. The MCUXpresso extension will use the latest available SEC:

Detect SEC

Then, using the latest available installed SEC Tool, the bootable executable will be generated:

Generating executable using SEC

The command used for invoking and generating the bootable image will appear in MCUXpresso for VS Code Output console, along with the output of the command.

The generated executable can be found in the .secureprovisioning folder inside the project.

After successful build, debug or flash the application.

i.MX95

Starting with MCUXpresso for VS Code 24.11.x, SEC features are used to generate bootable image using the needed additional images for the Cortex-M7 projects on i.MX95 target. Also, UUU (Universal Update Utility) tool will be used to debug the Cortex-M7 i.MX95 projects.

As a prerequisite, the board should be in serial download mode, boot from CM33, and an external MCU-Link or J-Link probe is connected to the JTAG port.

Import MCUXpresso SDK i.MX95 Cortex-M7 project and run the build project command.

It is expected that the build will fail the first time, as the needed information must be provided by the user as following:

  • Open the additional_images_mx95_cm7_app_cfg.json file that has been created in .secureprovisioning folder inside the project folder.

  • Edit the file to provide the correct paths for all the requested files listed in the json (DDR, TCM, system manager and ELE firmware). The paths can be relative to SEC workspace (the .secureprovisioning folder). Absolute paths and paths formed with user defined environment variables are also accepted.

Note:: Do not change nor remove the cortex_m7_app and v2x_dummy entries.

The SEC and UUU used commands, commands output, as well as any errors that might be SEC and UUU related, will appear in MCUXpresso for VS Code Output console.

Build the project again and debug or flash the application.

Note:: Debugging with J-Link requires a custom jlinkscript with the following implementation:

int InitTarget(void) {
    JLINK_SYS_Report("***************************************************");
    JLINK_SYS_Report("J-Link script: iMX95 initialization");
    JLINK_SYS_Report("***************************************************");

    // ********************************************************************
    JLINK_SYS_Report("... reset target via JTAG_ResetPin");
    JTAG_ResetPin = 0; JLINK_SYS_Sleep(100);
    JTAG_ResetPin = 1; JLINK_SYS_Sleep(100);
    JLINK_SYS_Report("... wait for target initialization after reset");
    JLINK_SYS_Sleep(6000);
    // ********************************************************************

    if (JLINK_ActiveTIF == JLINK_TIF_JTAG) {
        JLINK_SYS_Report("... JLINK_TIF_JTAG");
        JLINK_CORESIGHT_Configure("IRPre=0;DRPre=0;IRPost=4;DRPost=0;IRLenDevice=4");
    }
    else
    {
        JLINK_SYS_Report("... JLINK_TIF_SWD");
        JLINK_CORESIGHT_Configure("");
    }

    return 0;
}

void ResetTarget(void) {
    JLINK_TARGET_Halt(); // Make sure that the CPU is halted when reset is called
}

home