SPI NAND boot on i.MX8ULPHello,
I'm trying to boot from a SPI NAND on i.MX8ULP.
The evk has a SPI NOR attached and I was able to boot from it, but when trying with a NAND on our boards I cannot get this to work. I've configured BT*_CFG* pins and I see the boot ROM tries to read the NAND, but neither the M33 nor the A35 cores seem to boot, so I'm thinking the boot image is not correct.
I'm building the image with imx-mkimage flash_singleboot_m33_flexspi target, which uses the fspi_header file as header block, but the comments in this file seem to indicate that this is for Serial NOR and not for NAND, so I'm looking into this flexspi configuration block header.
How would one go about making an appropriate header file for our target?
I found kobs-ng but it doesn't seem to be intended for 8ulp (no GPMI NAND controller, and doesn't work even after patching lightly to run anyway)
I couldn't find any documentation about the FCFB block in the 8ulp documentation either. I found some documentation about it in the i.MX 8M Mini Applications Processor reference manual (and the u-boot patch adding options about it in u-boot mkimage), but even if it is indeed the same format then how to use it for i.MX8ULP (in particular what LUT table to use) would be appreciated.
Thank you,
Dominique Martinet
Re: SPI NAND boot on i.MX8ULPSorry to miss your messages, here could you share your schmetic sections on the 8ULP and SPI-NAND in your side? Also share us your ful failed log to us?
Re: SPI NAND boot on i.MX8ULPThank you for the answer.
The board successfully boots from SD card, so there is no obvious problem with the soc/memory (switching from BT*_CFG*)
I'll post the exact BT CFG pins and pins used later, but we can clearly observe the nand is being read at boot looking at the SPI transfer, so I think this part is probably correct and would like to check the fspi_header first.
Looking further yesterday I found nxpimage from SPSDK has commands for this, but it only seems to support nor flash for 8ulp, so I'm still stuck trying various parameters manually and some documentation/tooling like kobs to run on device would be appreciated
ThanksRe: SPI NAND boot on i.MX8ULPSorry for the delay.
For reference here's how the board is configured:
- boot fuses cleared (initial state as received)
- QSPI NAND connected as follow
| PTD12(FLEXSPI2_A_SS0_b) | /CS |
| PTD13(FLEXSPI2_A_SCLK) | CLK |
| PTD14(FLEXSPI2_A_DATA3) | /HOLD(IO3) |
| PTD15(FLEXSPI2_A_DATA2) | /WP(IO2) |
| PTD16(FLEXSPI2_A_DATA1) | DO(IO1) |
| PTD17(FLEXSPI2_A_DATA0) | DI(IO0) |
- boot pins as follow
- BOOT_MODE0 open (0), BOOT_MODE1 pulled up (1) = boot from pins
- BT0_CFG0 pulled down (no low power boot)
- BT0_CFG1 pulled down (dual boot M33/A35 "from eMMC"...)
- BT0_CFG2 ignored
- BT0_CFG3 pulled down/CFG4 pulled up (m33 boot interface, should be ignored in dual boot?)
- BT0_CFG5 ignored
- BT0_CFG6/7 both pulled down (24MHz external OSC)
- BT0_CFG[8-11] ignored
- BT0_CFG12/13 floating, CFG14 pulled down (I'm not clear if "flexspi device type" is meant as a m33 independant boot setting or affects both, just in case I tried setting it to 011 (flash with 4B READ(0x13), which is what our nand supports) with no visible difference)
- BT0_CFG15 ignored
- BT1_CFG[0-3] ignored
- BT1_CFG4 pulled down (eMMC fast boot disabled)
- BT1_CFG5 pulled down (speed normal)
- BT1_CFG6/7 pulled down (bus width 4)
- BT1_CFG8 ignored
- BT1_CFG9 pulled up (SD boot, should be ignored in spi boot mode)
- BT1_CFG10/11/12 pulled respectively down/up/down (USDHC2, likewise should be ignored)
- BT1_CFG13/14 pulled respectively up/down (SPI nand)
- BT1_CFG15 pulled down (recovery to SD boot)
If you can think of anything else to check please let me know, otherwise I'm still interested in documentation around the flash boot config block.
Thank you
Re: SPI NAND boot on i.MX8ULPHow about your hardware design for the SPI nand and boot mode? Do you have others flash in your board, such as emmc or sd card? IF yes, you can try it to see if system can boot up or not?
Re: SPI NAND boot on i.MX8ULPHi, @Rita_Wang
Thank you for your reply. I am mizo, a colleague of martinetd.
Currently, what we specifically need to know is how to create the boot image file for the SPI NAND.
The Reference Manual states that booting from an SPI NAND connected to FlexSPI2 is supported. However, we are currently unable to create the boot image because we do not know the exact format required for the image file header.
We assume that NXP has already successfully booted the i.MX8ULP from an SPI NAND internally. We would greatly appreciate it if you could either share the image file header format with us or provide the software/tool used to generate this header.
Thank you in advance for your support.
Re: SPI NAND boot on i.MX8ULPHi @Rita_Wang
Any update? We're blocked on this and any kind of help would be greatly appreciated
Thanks!
Re: SPI NAND boot on i.MX8ULPI got access to the Golden Shiny Oscilloscope™ and could confirm that, booting in that configuration, the chip reads the first part of the nand successfully (it issues a read 0x13 for block 0, polls the status register until the nand is no longer busy, then reads at least 2KB of data -- in particular I've confirmed the data being read matches the start of the imx-boot image with 1KB of zero followed by the FCFB header)
At this point nothing more happens, I'm not good enough with the scope to tell if more data was read later but it looks like it stopped reading, so I'd very much like to check if the fspi_header I wrote makes sense (I filled in 0x02 for serial nand instead of serial nor's 0x01, as well as SFlashA1Size, page size, sector size and block size, but left all the rest intact from where it was in the imx-mkimage repo)
I'd appreciate any pointer in how to write a valid fspi header for NAND.
Thank youRe: SPI NAND boot on i.MX8ULPI am try on my side, will update to you when I finished it.
Re: SPI NAND boot on i.MX8ULPHi @Rita_Wang
Are there any updates on this inquiry?
If booting from SPI NAND is not supported on the i.MX 8ULP, we need to start investigating alternative methods as soon as possible. Could you please at least confirm whether SPI NAND boot is actually possible on this SoC?
I checked arch/arm/mach-imx/cmd_nandbcb.c in the uboot-imx source, and I can see that imx8mn, imx8qx/qm, etc., are supported. Based on this, I assume SPI NAND boot should be possible.
Additionally, if there are other i.MX series processors that share the exact same SPI NAND boot specifications as the i.MX 8ULP, could you please let us know which ones they are so we can use them as a reference?
Thanks again for your support.
Re: SPI NAND boot on i.MX8ULPHi @Rita_Wang
Thank you for the update.
I have already built an i.MX8ULP custom board equipped with an SPI NAND Flash on my side. Therefore, if you could let me know how to build the boot image and the method to program it, I can test and verify it right away.
Would it be possible for you to share just the instructions and information with me in advance?
Best regards,
mizoRe: SPI NAND boot on i.MX8ULPHi @Rita_Wang
I received information that SPI NAND boot is supported with the same specifications as the i.MX91. I will try implementing it on our end.
Best regards,
mizoRe: SPI NAND boot on i.MX8ULPFor our i.MX8ULP ROM support the SPI NAND boot, for our EVK only support the SPI NOR, if customer want to use the SPI NAND please refer to the i.MX91 code. As discussed in the email.