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
已解决! 转到解答。
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.
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!
-----------------------------------------------------------------------------------------------------------------------
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!
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
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.
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