Using Hyperflash as Data-Storage

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using Hyperflash as Data-Storage

跳至解决方案
2,006 次查看
Masmiseim
Senior Contributor I

#MIMX-RT1050-EVK

Hello,

 

Are there any examples around how to use the Hyperflash as Data-Storage while simultaneously running code out of it?

I’m aware that the SDK has some examples for using the flexSPI with NOR and Hyperflash, but this example run out of the On-Chip-RAM.

I believe with running out of the Hyperflash things are a bit different. The Interface should be already initialized by the On-Chip-Bootloader. The routines doing the actual access should be running out of RAM (ITCM) … anything else?

 

Thanks and Regards

标记 (1)
0 项奖励
1 解答
1,727 次查看
art
NXP Employee
NXP Employee

Q. When booting from it everything should be initialized by the Bootloder, correct? All the things which are done in ‘FLEXSPI_Init’ shouldn’t be necessary, only the LUT should be initialized, right?

A. Seems that only the Read path of the FlexSPI controller is initialized by the BootROM code to XiP the code from HyperFlash. So, the right sequence seems to move the code that initializes the FlexSPI Write path and then performs read/erase/write to ITCM, then jump there, initialize the Write path first and then perform read/erase/write only from ITCM as a separate and complete routine.

在原帖中查看解决方案

0 项奖励
6 回复数
1,727 次查看
art
NXP Employee
NXP Employee

It is not possible to simultaneously execute the code in XiP mode and write data to physically the same HyperFlash memory. A separate HyperFlash memory on the differnt chip select should be used to store data. Or, the code should be loaded into RAM and executed from there.


Have a great day,
Artur

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
1,628 次查看
jose_au_zone
Contributor II

Hi Art. I hope you see this after those years

Did you mean that it is not possible to write to any address of the same hyperflash that's being used with XIP?

Even if my application is running, say in the first 4KB of a 32MB hyperflash, I cannot write to any address of such hyperflash?

 

Thanks!

0 项奖励
1,727 次查看
Masmiseim
Senior Contributor I

Hello Artur,

 

Thanks for the reply.

Is it enough to executed the Routines which do the actual reading\writing\erasing in the ITCM?
Based on the NXP-SDK: Is it enough that the routine FLEXSPI_TransferBlocking plus the ones called inside go into the ITCM and the rest is executed in XIP?

I tried to do that and my program is crashing when trying to erase and ending in an endless loop when trying to write some Data. The endless loop is in this one here:
while (!((status = base->INTR) & kFLEXSPI_IpTxFifoWatermarkEmpltyFlag))
{
}

Reading seems to be working fine.

 

What do I have to do for the initialization of the flexSPI. When booting from it everything should be initialized by the Bootloder, correct?
All the things which are done in ‘FLEXSPI_Init’ shouldn’t be necessary, only the LUT should be initialized, right?

 

Best Regards

0 项奖励
1,728 次查看
art
NXP Employee
NXP Employee

Q. When booting from it everything should be initialized by the Bootloder, correct? All the things which are done in ‘FLEXSPI_Init’ shouldn’t be necessary, only the LUT should be initialized, right?

A. Seems that only the Read path of the FlexSPI controller is initialized by the BootROM code to XiP the code from HyperFlash. So, the right sequence seems to move the code that initializes the FlexSPI Write path and then performs read/erase/write to ITCM, then jump there, initialize the Write path first and then perform read/erase/write only from ITCM as a separate and complete routine.

0 项奖励
1,727 次查看
Masmiseim
Senior Contributor I

Hey Artur,

 

now everything is working fine. We had some additional problems with the QSPI-Interface instead of the Hyperflash, but now it’s working.

 

Thank you.

0 项奖励
1,104 次查看
rathna
Contributor I

Hi NXP

 

Could this sample call functions and the code flow can be shared ??

 

We are trying to copy the contents from hyperflash to RAM area and then go for flash erase,write and read

with the hex files contents received from serial

 

thanks in advance

ratna

 

0 项奖励