Ⅰ、Introduction
The MCUXpresso Secure Provisioning Tool (SEC) tool is a GUI-based application provided to simplify generation and provisioning of bootable executables on NXP MCU platforms. The latest version of SEC v8 adds FCB configuration function to help users program image to external flash.
The MCX N94x family is a typical product series of MCX. A controller with a flexible serial peripheral interface (FlexSPI) that supports external memory. The external flash has a large storage capacity, high flexibility. It is relatively independent of the replacement or upgrade of the main chip, and has high reliability and lifecycle.
This article focuses on how to use SEC tools to configure and program MCXN947 external flash quickly and easily.
Ⅱ、Configuration steps
This article uses the FRDM-MCXN947 board as an example to configure FCB and download an external flash image.
Hardware requirements: FRDM-MCXN947 board、Type-C USB cable
Software requirements: MCUXpresso Secure Provisioning Tool | NXP Semiconductors
Step1. Create new workspace
After opening the software, click File->New Workspace, select "MCX N94x/N54x" -> MCXN947 -> Click "create". Refer to the following figure:
Step2. Connection with Target Processor
Enter ISP mode:Press and hold SW3(ISP key) => Press and release SW1 (RESET key) => Release SW3
Go to your workspace and click “Target”->Connection, the Connection with Target Processor window is displayed. Here, we make Connection through UART and select port and baud rate. Refer to the following figure:
We can click "Test connection" to check whether the connection is successful. If the connection is successful, the result will display "OK". Refer to the following figure:
Step3. Boot memory configuration
Next we need to configure FCB. Click on "Target"-> Boot Memory… ,The Boot memory configuration window is displayed. First we need to select the Boot memory type, this part allows selection of the boot memory type, and optionally instance. The selection contains all memory types but unsupported types are disabled.
FlexSPI NOR flash can be configured in two ways:
Here we use a simple configuration, click "FlexSPI NOR-simplified", on this Predefined template, select W25Q64JW and click apply. Then, corresponding parameters on W25Q64JW will be automatically created on Boot memory configuration parameters. Normally, keep the default value. Refer to the following figure:
We use "Test the configuration" to check whether the configuration is correct. After clicking "Test", the script will pop up to run automatically, and "SUCCESS" will be displayed after running. Refer to the following figure:
Then click "convert to FCB" and the "convert to FCB" dialog box will pop up. Keep the default position of "FCB file path". Select "Apply the converted FCB as boot device configuration" and click "convert". The script automatically runs and generates "converted_fcb.bin". The FlexSPI NOR-complete FCB window is displayed. Refer to the following figure:
The generated converted_fcb.bin file is automatically loaded to FCB file for runtime and FCB File for write. Click "Test" and "SUCCESS" will be displayed. Click "OK" to close the window. Refer to the following figure:
Step4. Build image
After completing the above operations, we need to load the .s19 or .hex file generated by MCUXpresso IDE into the Source executable image.
Note: The start address of the external flash of the project needs to be changed to 0x80001000. This section does not explain how to change the start address. For details, see “How to config booting from external flash”.
After the file is loaded, the start address is automatically identified. If the start address is not 0x80001000, you cannot "built image". Then click on "built image". Refer to the following figure:
After completing the built image, "SUCCECC: built image" will be displayed. Click "close". Refer to the following figure:
Step5. Write image
We can see that the required .bin file has been generated automatically in "write image", or we can import the corresponding .bin file we wrote by "import". The Image path file will be automatically loaded. Click "write image" to run the script automatically. After the file is successfully written, "SUCCESS: write image" is displayed. Refer to the following figure:
Finally, by pressing the RESET key on the board to exit ISP mode, we completed the configuration and downloaded the external flash image.
Ⅲ、Summarize
We use SEC Tool to configure FCB and download external flash images via GUI. This is just a simple method, and users can choose different ways according to their requirements.