Help needed booting IMXRT1170 from FLEXSPI2

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

Help needed booting IMXRT1170 from FLEXSPI2

4,565 Views
neilturner
Contributor III

I am struggling to get my i.MXRT1170 to boot over the FLEXSPI2 interface and looking for help!

Our design will be using a HyperRAM on FLEXSPI1 and an SPI Flash chip on FLEXSPI2 as the boot device. We are at the prototype stage and have modified an IMXRT1170-EVK to include a Micron MT25QU256ABA chip connected to the FLEXSPI2 interface (by using the SD1 connections on the board). Our code can program and erase this chip quite successfully so I am confident the hardware is working. We have also blown the FLEXSPI_PIN_GROUP_SEL fuse so the boot code will configure the alternate pins for FLEXSPI2 during the boot (these are the same pins used by SD1 on the EVK). However after many days of effort we cannot get the RT1170 to boot from code programmed in this chip.

I should point out that I am pretty familiar with programming the IVT, flash config block etc. on IMX processors having done this several times before on previous projects (on i.MX6, i.MX8Nano and i.MX8Mini).

The following shows output from the debugger reading the contents of the flash SPI chip (accessing via it’s 0x60000000 AHB memory map address). As far as I can tell the Flash Config block, IVT and Boot Data block are located correctly.

neilturner_0-1651679343456.png

 

If I reset the process and monitor the FLEXSPI signals I can see the boot code first read and check the 0x42464346 tag at address 0x400 it then reads the whole of the flash config block. After a short delay it then reads roughly 4kbytes and stops. Unfortunately I don’t have the logging facilities to be able to see what addresses it actually reads after the first access to 0x400, but I assume this 4K read is to access the IVT and Boot Data structures so I suspect there is something it does not like about them…..but I just cannot see it!

If I attach to the running target with my debugger at this point the processor appears to be looping in the boot rom code at address 0x223104.

 

    0x22'30fa: 0xf24c 0x00b0  MOVW      R0, #49328              ; 0xc0b0

    0x22'30fe: 0xf2c4 0x00ca  MOVT      R0, #16586              ; 0x40ca

    0x22'3102: 0x6801         LDR       R1, [R0]

    0x22'3104: 0xe7fe         B.N       0x22'3104

    0x22'3106: 0xf7de 0xb826  B.W       0x20'1156

    0x22'310a: 0xf7de 0xb824  B.W       0x20'1156

    0x22'310e: 0xb530         PUSH      {R4, R5, LR}

 

If I examine the memory at 0x20250000 and above I can see no evidence that the boot code attempted to load the image into the OCRAM where it runs.

I am basically stuck at this point and would appreciate any ideas…

0 Kudos
Reply
16 Replies

4,233 Views
Ajas
Contributor I

hello Neil 

have you solved this issue ?

0 Kudos
Reply

4,230 Views
neilturner
Contributor III

No the issue remains...but we are working around it for now in order to get on with other development. We will be returning to it soon.

0 Kudos
Reply

4,234 Views
Ajas
Contributor I

Hello Neil,

did you solved the issue ?

If yes can you tell us

0 Kudos
Reply

4,558 Views
jay_heng
NXP Employee
NXP Employee

Can you please try to use MCUBootUtility tool to download you binary? this tool can generate all necessary boot headers for you binary automatically. the generated headers are always valid.

0 Kudos
Reply

4,218 Views
vishnusudhankj
Contributor III

Hi @jay_heng 

I tried to use FLEXSPI2 NOR flash & used MCUIDE sample LED program to flash over SPT for i.MXRT 1160 EVK as below,

vishnusudhankj_0-1662524744882.png

I changed the flash base address to 0x60000000(since FLEX NOR SPI2 needs to be reside that memory address) & chose FLESPI2 configuration as below.

 

vishnusudhankj_1-1662524948613.png

I could able to build the image , but while try to flash the image shows as SFDP not found.

 

blhost -t 5000 -u 0x15A2,0x0073 -j -- configure-memory 9 0x2000
{
"command": "configure-memory",
"response": [],
"status": {
"description": "20107 (0x4e8b) FlexSPINOR: SFDP Not Found.",
"value": 20107
}
}
blhost failed

Let me know is there any other modification needs to be adapt for FLEX SPI NOR2 ?

 

 

 

 

 

0 Kudos
Reply

4,558 Views
jay_heng
NXP Employee
NXP Employee

You connect Flash to GPIO_SD_B1[05:00] right?

Have you burnt below fuse region?

eFuse 0x940 FLEXSPI_INSTANCE =1

eFuse 0x9A0 FLEXSPI_PIN_GROUP_SEL =1

eFuse 0x9A0 FLEXSPI_CONNECTION_SEL =0

0 Kudos
Reply

4,555 Views
neilturner
Contributor III

Thanks for your help.

I have blown the FLEXSPI_PIN_GROUP_SEL  but not the FLEXSPI_INSTANCE fuse. I am selecting FLEXSPI2 using a GPIO override via the boot switches on the board. As I said in the original post, I can see (via an oscilloscope) the initial read happening on FLEXSPI2 when I attempt the boot. I can see it read the flash config block and then another read of roughly 4Kbytes. In fact if I deliberately corrupt the 0x42464346 tag at the start of the flash config block I can see the boot stop immediately after reading this tag (as it is now wrong). So I am confident all the boot parameters are correctly set. 

0 Kudos
Reply

4,552 Views
jay_heng
NXP Employee
NXP Employee

It seems to be IVT, Boot Data header issue, you can try MCUBootUtility tool to generate headers.

0 Kudos
Reply

4,548 Views
neilturner
Contributor III

Is it possible to make the MCUBootUtility write to my flash device connected to FLEXSPI2? Currently when I set it all up it is writing the image to the Octal flash device which is still connected to FLEXSPI1 on my EVK board (I will eventually replace this with a Hyper RAM). I cannot test a boot from this device since it is connected to the Primary pins of FLEXSPI1 and I have blown the fuse to specify the boot from the secondary pins.....

However I have replicated in my code the IVT and Boot Data I see MCUBootUtility create and written it to the FLEXSPI2 device along with the image (as follows)

MCUBootUtility IVT and Boot Data:

neilturner_0-1651767025050.png

My flash device on FLEXSPI2 contains the same,

neilturner_1-1651767069246.png

yet it still will not boot with no change in the behaviour! Any more throughts?

 

0 Kudos
Reply

4,532 Views
jay_heng
NXP Employee
NXP Employee

Set MCUBootUtility / Tools / FlexSPI XIP Region to 1, then it will download app into FlexSPI2 flash

0 Kudos
Reply

4,518 Views
neilturner
Contributor III

I have just noticed this error in the CMD window as well as the error reported in my previous post...

neilturner_0-1652086896528.png

 

0 Kudos
Reply

4,522 Views
neilturner
Contributor III

Thank you for the information, however if I make this change I cannot connect to the target board, I get the following error,

neilturner_0-1652085910041.png

I suspect this may be because my flash device is connected to the alternate pins for FLEXSPI2 rather than the primary pins. Is there any way around this?

Another question. My image is NOT intended to run as XIP it has to be copied to ITCM before execution (I have also tried linking to place it in OCRAM with no change in behaviour). Does the MCU Boot Utility or the boot roms assume an image is XIP or does it use the start address in the Boot_Data structure to know whether it has to copy the image to the destination memory or to just run it in place in flash? 

 

0 Kudos
Reply

4,506 Views
jay_heng
NXP Employee
NXP Employee

1.Select below opt and try again.

Sec_opt.PNG

2.BootROM can support both XIP and Non-XIP image, you can just provide raw image to MCUBootUtility, tool can add necessary header for ROM boot

0 Kudos
Reply

4,496 Views
neilturner
Contributor III

Thank you once again for your response.

If I change the settings as you suggest then the MCUBootUtility does get further, however it later hangs whilst attempting to erase the area of the flash which will contain the FLEXSPI config block (0x400). I have attached a log (MCUBootUtilLog.txt) of the commands and responses from the CMD window.

I know the flash chip is erased (I have erased it with my code and it reads back as 0xFFFFFFFF) so I suspect MCUBootUtility may be setting the clock speed of the FLEXSPI2 interface too high. Due to the prototype wiring to connect the flash chip to the EVK board it will only work up to 88MHz. What clock speed does the MCUBootUtility configure the FLEXSPI? Is it possible to change it? I did try setting the "Max Frequency" in the FlexSPI NOR Device Configuration window to 30MHz but I have a feeling this only applies to the generation of the Flash config block as it makes no difference to the behaviour.

neilturner_0-1652182253414.png

This is the contents of flexspiNorCfg.bin as read back by MCUBootUtility command, "blhost -t 5242000 -p COM4,115200 -j -- read-memory 1610613760 1024 Z:\NXP-MCUBootUtility-master\tools\blhost2_3\win\vectors\flexspiNorCfg.dat 9" which is clearly not correct for erased flash.

neilturner_1-1652182394566.png

Does the MCUBootUtility store the generated flash config block in a file anywhere? I can see it generate the bootable image as a .bin file, but this file does not contain the flash config block it only has the IVT and boot data appended to the binary image.

0 Kudos
Reply

4,205 Views
jay_heng
NXP Employee
NXP Employee

You can try 'Write (Auto Erase)' button in Boot Device Memory sheet, not to use 'All-in-one Action' button.

flash config block is generated by tool dynamically

0 Kudos
Reply

4,199 Views
vishnusudhankj
Contributor III

HI @jay_heng ,

 

I am using SPT V4.1 .

 I can't able to connect the iMXRT1160 EVK using MCUBoot utility tool.

Is there any steps available , how to load & boot MCUBOOT from FLEX SPI2 NOR?

0 Kudos
Reply