Using Hyperflash as Data-Storage

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

Using Hyperflash as Data-Storage

Jump to solution
2,737 Views
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

Tags (1)
0 Kudos
Reply
1 Solution
2,458 Views
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.

View solution in original post

0 Kudos
Reply
6 Replies
2,458 Views
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 Kudos
Reply
2,359 Views
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 Kudos
Reply
2,458 Views
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 Kudos
Reply
2,459 Views
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 Kudos
Reply
2,458 Views
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 Kudos
Reply
1,835 Views
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 Kudos
Reply