How To Enable Debugging For FLEXSPI NOR Flash: 2.1 EVK Settings
How To Enable Debugging For FLEXSPI NOR Flash: 2.1 EVK Settings
Contents
1 Introduction 1 Introduction.......................................... 1
The i.MX RT series is industry’s first crossover processor provided by NXP. This 2 MIMXRT1050 EVK board settings.......1
document describes how to program a bootable image into the external storage
3 XIP boot flow........................................ 3
device. In order to program image to flash and boot from flash and debug, the
new Dap-link Firmware and SDK are provided. This application notedescribes 4 Updating OpenSDA firmware............. 7
how to program, debug and configure a new FLEXSPI NOR flash. For 5 Examples.............................................. 7
information about Flashloader, MfgTool, refer to How to Enable Boot from
HyperFlash and SD Card (document AN12107) and How to Enable Boot from 6 Revision history................................. 20
QSPI Flash (document AN12108).
The software used for examples in this application note are based on the MIMXRT1050 SDK (Release version: 2.3.1). The
development environment is IAR Embedded Workbench 8.22.1. The hardware development environment is IMXRT1050-EVKB
board.
3. Replace the firmware of OpenSDA. The default firmware On-Board is used to Hyper Flash, so that the firmware should be
replaced to QSPI NOR Flash. Both Hyper Flash and QSPI NOR Flash’s firmware can be downloaded from https://
www.nxp.com.
Figure 3 shows FlexSPI NOR Flash Boot flow. The ROM expects the 512-byte FlexSPI NOR configuration parameters to be
present at offset 0 in Serial NOR Flash. The ROM reads these configuration parameters using the read command specified by
BOOT_CFG2[2:0] with Serial clock operating at 30 MHz. The Flash configuration parameters include read command sequence,
FlexSPI frequency, quad mode enablement sequence (optional), and so on. For more details, refer to Section 9.6.3 in i.MX RT1050
Process Reference Manual (document IMXRT1050RM). Rom code will configure FlexSPI with these parameters.
Then Rom code will get some key information about App Image, Image Vector Table (IVT), Boot Data and Device Configuration
Data (DCD). IVT, Boot Data, DCD and user’s code make up an App image.
A boot image which can program to FlexSPI NOR Flash directly consists of:
• Flash Configuration Parameters: Read command sequence, FlexSPI frequency, quad mode enablement sequence
(optional), and so on. For more details, refer to Section 9.6.3 in i.MX RT1050 Process Reference Manual (document
IMXRT1050RM). Search for hyperflash_config on SDK, the setting can be found on SDK.
• IVT: A list of pointers located at a fixed address that the ROM examines to determine where the other components of the
program image are located. Search for image_vector_table on SDK, the setting can be found on SDK. For more details,
refer to Section 9.7.1 in i.MX RT1050 Process Reference Manual (document IMXRT1050RM).
• Boot data: A table that indicates the program image location, program image size in bytes, and the plugin flag. Search for
boot_data on SDK, the setting can be found on SDK.
• DCD: IC configuration data (ex: SDRAM register config). For more details about DCD format, refer to Section 9.7.2 in i.MX
RT1050 Process Reference Manual (document IMXRT1050RM). Because DCD data is stored in binary, it is hard to
understand and modified. DCD Tool can help to convert the configuration text file to a binary file. Search for dcd_data[] on
SDK, the setting can be found on SDK.
• User code and data
Open the link file, MIMXRT1052xxxxx_flexspi_nor.icf, the address layout of Flash configuration parameters, IVT, Boot Data
and DCD Data can be found.
Open a generated image, such as hello_world.bin. The Flash configuration parameters are at the front. The tag of Flash
configuration parameters is 0x42464346, ascii is FCFB, as shown in Figure 6. For more details, refer to Section 9.6.3.1 in i.MX
RT1050 Process Reference Manual (document IMXRT1050RM).
The tag of IVT is 0xD1 and it can be found on 0x1000. The boot start address offset is 0x1020 and the data is 0x6000000, which
matches with Flash start address. The DCD start address offset is 0x1030 and the data is 0xD2 which matches with the Tag of
DCD.
5 Examples
NOTE
When using DapLink to debug flexspi_nor_debug and flexspi_nor_release targets, please set the
breakpoint type to hardware breakpoint.
XIP_EXTERNAL_FLASH 1: To exclude the code which will change the clock of flexspi.
0: To make no changes.
XIP_BOOT_HEADER_ENABLE 1: To add flexspi configuration block, IVT, boot data, and DCD (optional)
to the image by default.
0: To add nothing to the image by default.
Table 3 describes the different effect on the built image with different combination of these macros.
XIP_BOOT_HEADER_DCD_ENABLE=1 XIP_BOOT_HEADER_DCD_ENABLE=0
XIP_E XIP_BOOT_HEA This imaage can be programed to hyperflash This image can be programed to hyperflash
XTERN DER_ENABLE=1 by IDE and can run after POR reset if by IDE and can run after POR reset if
AL_FL hyperflash is the boot source. hyperflash is the boot source.
ASH=1
SDRAM will be initialized. SDRAM will NOT be initialized.
XIP_BOOT_HEA This image can NOT run after POR reset if it is programed by IDE even if hyperflash is the
DER_ENABLE=0 boot source.
XIP_EXTERNAL_FLASH=0 This image can NOT do XIP because when this macro is set to 1. It will exclude the code
which will change the clock of flexspi.
2. Open the hello_world demo in the SDK and select the project configuration as flexspi_nor_debug. Then build the project
and program the image to the Flash.
4. Then build the project and program the image to the Flash. Then, Hello World can be printed on the terminal.
2. Open the IAR project, FlashIMXRT1050_EVK_FlexSPI_Example in the attachment. Build the project and find
FlashIMXRT1050_EVK_FlexSPI.out. Then copy it to IAR install path.
3. Build the project and download. Then, Hello World can be printed on the terminal.
NOTE
The default flashloader can be found in your IAR install path: IAR Systems\Embedded Workbench
8.0_2\arm\src\flashloader\NXP\FlashIMXRT1050_EVK_FlexSPI.
NOTE
The power supply of GD25Q64C is 3.3 V, but the default power supply is 1.8 V. DO modify the power supply voltage.
The difference is the value of Write Status Register and the command format, so that the value related with these registers need
to modify.
1. Open the FlashIMXRT1050_EVK_FlexSPI_Example with IAR. Find the LUT and modify the value, as shown in Figure 18.
Figure 18. Modify the value form ISSI_CMD_WRSR from 0x01H to 0x31H
3. Build this project and copy the .out file as described in Programming the image to On-Board QSPI NOR Flash.
5.5 Programming the image to a new QSPI NOR Flash with MCUXpresso IDE
Select MIMXRT10XX_SFDP_QSPI.cfx for LinkServer flash driver. Almost all standard SPI NOR Flash support SFDP.
The following gives examples for how to modify the parameters of FLEXSPI_LUT_SEQ() for NOR flash XIP booting.
6 Revision history
Table 4. Revision history
While NXP has implemented advanced security features, all products may be subject to
unidentified vulnerabilities. Customers are responsible for the design and operation of their
applications and products to reduce the effect of these vulnerabilities on customer’s applications
and products, and NXP accepts no liability for any vulnerability that is discovered. Customers
should implement appropriate design and operating safeguards to minimize the risks associated
with their applications and products.
NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, COOLFLUX,
EMBRACE, GREENCHIP, HITAG, I2C BUS, ICODE, JCOP, LIFE VIBES, MIFARE, MIFARE
CLASSIC, MIFARE DESFire, MIFARE PLUS, MIFARE FLEX, MANTIS, MIFARE ULTRALIGHT,
MIFARE4MOBILE, MIGLO, NTAG, ROADLINK, SMARTLX, SMARTMX, STARPLUG, TOPFET,
TRENCHMOS, UCODE, Freescale, the Freescale logo, AltiVec, C‑5, CodeTEST, CodeWarrior,
ColdFire, ColdFire+, C‑Ware, the Energy Efficient Solutions logo, Kinetis, Layerscape, MagniV,
mobileGT, PEG, PowerQUICC, Processor Expert, QorIQ, QorIQ Qonverge, Ready Play,
SafeAssure, the SafeAssure logo, StarCore, Symphony, VortiQa, Vybrid, Airfast, BeeKit,
BeeStack, CoreNet, Flexis, MXC, Platform in a Package, QUICC Engine, SMARTMOS, Tower,
TurboLink, and UMEMS are trademarks of NXP B.V. All other product or service names are the
property of their respective owners. AMBA, Arm, Arm7, Arm7TDMI, Arm9, Arm11, Artisan,
big.LITTLE, Cordio, CoreLink, CoreSight, Cortex, DesignStart, DynamIQ, Jazelle, Keil, Mali,
Mbed, Mbed Enabled, NEON, POP, RealView, SecurCore, Socrates, Thumb, TrustZone, ULINK,
ULINK2, ULINK-ME, ULINK-PLUS, ULINKpro, µVision, Versatile are trademarks or registered
trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. The related
technology may be protected by any or all of patents, copyrights, designs and trade secrets. All
rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. The
Power Architecture and Power.org word marks and the Power and Power.org logos and related
marks are trademarks and service marks licensed by Power.org.