Using SEC Tool Config and Program Image to External Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using SEC Tool Config and Program Image to External Flash

Using SEC Tool Config and Program Image to External Flash

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:

Alice_Yang_0-1706162509527.png

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:

Alice_Yang_3-1706162551392.png

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:

Alice_Yang_2-1706162542914.png

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:

  • By using the flashloader/ROM based simple configuration in the Boot Memory Configuration dialog or
  • By using the complete FCB (FCB binary), which can be prepared from the boot device configuration as well, or via MCUXpresso IDE by adding the FCB component into Peripheral Drivers in Peripherals tools, where the full configuration can be specified.

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:

Alice_Yang_4-1706162633118.png

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:

Alice_Yang_5-1706162645867.png

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:

Alice_Yang_6-1706162661116.pngAlice_Yang_8-1706162705497.png

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:

Alice_Yang_11-1706162940787.png

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:

Alice_Yang_12-1706162963275.png

After completing the built image, "SUCCECC: built image" will be displayed. Click "close". Refer to the following figure:

Alice_Yang_9-1706162740305.png

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:

Alice_Yang_10-1706162773783.png
Alice_Yang_13-1706162993947.png

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.

Labels (2)
0% helpful (0/1)
Version history
Last update:
‎01-24-2024 11:20 PM
Updated by: