[RT105x] How to boot from serial NOR Flash via 'FlexSPI NOR - QSPI - 2nd Option'

cancel
Showing results for 
Search instead for 
Did you mean: 

[RT105x] How to boot from serial NOR Flash via 'FlexSPI NOR - QSPI - 2nd Option'

Jump to solution
119 Views
JerryQian_Shure
Contributor I

We have a design which connects one NOR Flash with FlexSPI 2nd Option. I means choose the pins of 'FlexSPI NOR - QSPI - 2nd Option' of 'Table 9-1. ROM Bootloader Peripheral PinMux' in reference manual.

Snipaste_2021-02-10_09-20-14.png

When I read the chapter of '9.6.1.3 FlexSPI NOR boot flow chart', it looks like there are two steps about FlexSPI pinmux configurations in BootROM.

  1. Configure FlexSPI Pinmux and Clock to 30MHz to perform basic read operation to get Configuration parameter
  2. Configure IOMUXC, LUT, controller and clock based on the configuration parameter read from Flash device to get bootable image

Snipaste_2021-02-10_09-19-33.png

So, I think need to make BootROM selects FlexSPI QSPI - 2nd Option in step 1, and make configuration parameter have the correct IOMUXC in step 2. But I have two questions about two steps.

  1. How BootROM select FlexSPI Pinmux in step 1?
    • Is it configured in fuse? I haven't found any related in Fusemap Descriptions Table.
  2. How to write IOMUXC to Configuration parameter in step 2?  
    • I read the i.MX MCU Manufacturing User's Guide.pdf. Because mfgtool is what we want to use. Chapter '5.1.2. Generate SB file for plaintext FlexSPI NOR image programming' has a example about FlexSPI NOR Configuration Option block. But it doesn't have any configuration about IOMUXC.

Can anyone help on this?

Labels (1)
0 Kudos
1 Solution
85 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

Regarding your questions please see my comments below. 

How BootROM select FlexSPI Pinmux in step 1?
Is it configured in fuse? I haven't found any related in Fusemap Descriptions Table.

Yes, this is configured through the Fusempa, please see the below image. 

victorjimenez_0-1613000435102.png

How to write IOMUXC to Configuration parameter in step 2?  
I read the i.MX MCU Manufacturing User's Guide.pdf. Because mfgtool is what we want to use. Chapter '5.1.2. Generate SB file for plaintext FlexSPI NOR image programming' has a example about FlexSPI NOR Configuration Option block. But it doesn't have any configuration about IOMUXC.

The IOMUXC registers mentioned in step 2 are configured by the ROM bootloader. Table 9-1 of the reference manual shows all the pins that are configured by the ROM bootloader. 

Regards,
Victor  

View solution in original post

0 Kudos
4 Replies
86 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

Regarding your questions please see my comments below. 

How BootROM select FlexSPI Pinmux in step 1?
Is it configured in fuse? I haven't found any related in Fusemap Descriptions Table.

Yes, this is configured through the Fusempa, please see the below image. 

victorjimenez_0-1613000435102.png

How to write IOMUXC to Configuration parameter in step 2?  
I read the i.MX MCU Manufacturing User's Guide.pdf. Because mfgtool is what we want to use. Chapter '5.1.2. Generate SB file for plaintext FlexSPI NOR image programming' has a example about FlexSPI NOR Configuration Option block. But it doesn't have any configuration about IOMUXC.

The IOMUXC registers mentioned in step 2 are configured by the ROM bootloader. Table 9-1 of the reference manual shows all the pins that are configured by the ROM bootloader. 

Regards,
Victor  

View solution in original post

0 Kudos
64 Views
JerryQian_Shure
Contributor I

Hi Victor,

Sorry for late reply. 

Thanks for answer of Step 1. But for Step 2, Use of "FlexSPI NOR - QSPI - 2nd Option" in Table mentions the ROM will read 512-byte FlexSPI NOR configuration parameters. In Table 9-14, Table 9-15 and Table 9-17, no configuration is related to PINMUX. Does this mean BOOT_CFG2[2:0] has selected the correct group of PINMUX when boot? 

If so, I have another question about SB file which is mentioned in i.MX MCU Manufacturing User's Guide.pdf. Figure 18 has an example of FlexSPI NOR programming. I think (2) (3) is to tell Flashloader how to configure FlexSPI for programming. (5) (6) is to tell Flashloader how to program 512-byte FlexSPI NOR configuration parameters (I suppose SB file with generate and program this 512-byte section). How to tell Flashloader select the correct PINMUX for programming? Looks like the bits of Flash option in (2) doesn't have. Any other options? Table 8-4 in MCUX Flashloader Reference Manual.pdf only has details of option0.

I got i.MX MCU Manufacturing User's Guide.pdf and MCUX Flashloader Reference Manual.pdf from package of Flashloader i.MX-RT1050 in the home page of i.MX RT1050.

Snipaste_2021-02-18_10-42-09.png

JerryQian_Shure_0-1613618275771.png

Thanks

Jerry

0 Kudos
44 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Jerry, 

In step 1 of the flow chart that you shared before, the ROM bootloader will check the values of the fuses as well as the boot mode configuration and it initializes the corresponding pins to communicate with the memory. It's the bootloader that selects the corresponding pins. 

Regards,
Victor 

 

0 Kudos
27 Views
JerryQian_Shure
Contributor I

Hi Vector,

I have connected one external NOR flash to my EVKB. And make bd file as below to build SB file. Programming and boot are working. 

My another change is for Flashloader which source code from SDK. My prototype fails with 0xEBh(fast read quad). It could fail at 0x1700, 0x1F00 or 0x2000. And logic analyzer got the wrong data as RT1050. Maybe it's caused by my long wires. So I replaced with 0x03h(normal read), which works finally.

However, I think my prototype has proved it works.

Thanks

Jerry

 

bd file

# The source block assign file name to identifiers
sources {
myBinFile = extern (0);
}

constants {
kAbsAddr_Start= 0x60000000;
kAbsAddr_Ivt = 0x60001000;
kAbsAddr_App = 0x60002000;
}

# The section block specifies the sequence of boot commands to be written to the SB file
section (0) {

#1. Prepare Flash option
# 0xc0000103 is the tag for Serial NOR parameter selection
# bit [31:28] Tag fixed to 0x0C
# bit [27:24] Option size fixed to 0
# bit [23:20] Flash type option
# 0 - QuadSPI SDR NOR
# 1 - QUadSPI DDR NOR
# 2 - HyperFLASH 1V8
# 3 - HyperFLASH 3V
# 4 - Macronix Octal DDR
# 6 - Micron Octal DDR
# 8 - Adesto EcoXIP DDR
# bit [19:16] Query pads (Pads used for query Flash Parameters)
# 0 - 1
# 2 - 4
# 3 - 8
# bit [15:12] CMD pads (Pads used for query Flash Parameters)
# 0 - 1
# 2 - 4
# 3 - 8
# bit [11: 08] Quad Mode Entry Setting
# 0 - Not Configured, apply to devices:
# - With Quad Mode enabled by default or
# - Compliant with JESD216A/B or later revision
# 1 - Set bit 6 in Status Register 1
# 2 - Set bit 1 in Status Register 2
# 3 - Set bit 7 in Status Register 2
# 4 - Set bit 1 in Status Register 2 by 0x31 command
# bit [07: 04] Misc. control field
# 3 - Data Order swapped, used for Macronix OctaFLASH devcies only (except MX25UM51345G)
# 4 - Second QSPI NOR Pinmux
# bit [03: 00] Flash Frequency, device specific
load 0xC1000103 > 0x2000;
load 0x00010000 > 0x2004;
# Configure QSPI NOR FLASH using option a address 0x2000
enable flexspinor 0x2000;

#2 Erase flash as needed.(Here only 1MBytes are erased)
erase 0x60000000..0x6000FC00;

#3. Program config block
# 0xf000000f is the tag to notify Flashloader to program FlexSPI NOR config block to the start of device
load 0xf000000f > 0x3000;
# Notify Flashloader to response the option at address 0x3000
enable flexspinor 0x3000;

#5. Program image
load myBinFile > kAbsAddr_Ivt;

#6. Program Fuse as needed
load fuse 0x00000700 > 0x05; #FLASH TYPE: 111 - QSPI device supports 3B read by default (on secondary pinmux option)
load fuse 0x00000010 > 0x06; #BT_FUSE_SEL=1
}

0 Kudos