Programming Firmware Image Using the SEC Tool
In this lab, you will use the MCUXpresso Secure Provisioning tool to update the image in ISP mode after the customer's product has entered mass production.
The Flash Programmer is a simple tool within the SEC. Flash Programmer is designed to read/write from the currently selected flash memory and supports all flash types including internal flash, external NOR and NAND flash, SD card, and eMMC. Flash Programmer can be accessed from Tools in the menu bar. The processor can be connected to the host using USB, UART, SPI, or I2C and must be in ISP mode. Flash Programmer can be used to prepare data for writing, or just to display or modify saved memory blocks even if no device is connected. The left side contains the action toolbar and the right side contains a buffer of the memory content in hexadecimal and ASCII formats. The tool has additional functionalities: “Auto erase” and “Auto verify”. To display memory value from some address, fill in the start address into the Address combo and required size (in Bytes) into the Size combo. Click Read and the value read from memory will be displayed. The result of the operation is displayed in the bottom-left corner. If the operation ends with failure, more detailed info about the encountered error is displayed in the tooltip. The settings of the flash programmer window are not saved into the workspace. They are discarded if the tool is closed.
This lab uses the Flash Programmer to program an image into the MCXN947.
Hardware Requirements
Host PC with at least one USB port available.
FRDM-MCXN947 board
USB cable
Software Requirements
MCUXpresso IDE v24.12 or later downloadable here (download needs a nxp.com valid account). Make sure you install all drivers prompted during install process.
MCUXpresso Secure Provisioning Tool version 25.03.01 or later, downloadable here (download needs an nxp.com valid account). Make sure you download the package relevant to your OS (Mac AARCH OS, Linux DEB, Windows, Mac OS Intel x86_64).
MCUXPresso SDK for the FRDM-MCXN947(version 25.03.00) board downloadable here (if the specific version is not available to you in the SDK portal you can download the SDK directly from here).
Terminal program, like PuTTY or Tera Term (optional)
Schematics of the FRDM-MCXN947.Can be found here.
Steps
1. Create a S-record binary image
To leverage the use of the MCUXpresso Secure Provisioning Tool we need to work with binary images, the first thing we need to do is to generate them. Luckily, MCUXPresso IDE has a set of functionalities that allow us to do this operation in very few mouse clicks.
Open the MCUXpresso IDE, by double clicking on the desktop icon.
In the MCUXpresso IDE Quickstart panel click on “Import SDK example(s)…”
Select the MCXN947 , then select frdmmcxn947 board. Press then Next.
Expand the demo_apps tab, select the “led_blinky_peripheral_cm33_core0” and press Finish button.
Build the project, you will see the binary file plus debug extensions
“frdmmcxn947_led_blinky_peripheral_cm33_core0.axf”
Right click on the above file and from the context menu select Binary Utilities and click on the Create S-Record option (as per the picture below). This will create a binary file with extension .s19:
Now we have the .s19file
2. Prepare the MCUXpresso Secure Provisioning environment for programming:
Open the MCUXpresso Secure Provisioning Tool by double clicking on the desktop icon.
Create a new workspace clicking on File -> New Workspace option in the toolbar (or Ctrl+N).
Enter a folder name and configure the workspace as follows:
Enter workspace folder name.
Select MCXN947.
Click Create button to create.
3. Make MCU boot in ISP mode
Press and hold the ISP button (SW3) on the board, and at the same time, connect the USB cable to the HS-USB port (J11). Then release the ISP button.
Use SPT tool test whether can connect with ISP mode. Click Target-> Connections…
The USB port will be automatically recognized. Then, click the "Test connection" button. If the result shows "OK", it means the connection is good.
4. Program plain unsigned image (Generated from MCUXpresso IDE without any change)
Open the Flash Programmer view through Tools->Flash Programmer
Load the image to Flash Programmer tool as below:
Erase flash and Write the image.
Reset board, blinky demo start to run.
This is the video that shows all the detailed steps.
查看全文