Read and write from external Nor flash connected with FLEXSPI

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

Read and write from external Nor flash connected with FLEXSPI

跳至解决方案
1,708 次查看
shaileshnsec
Contributor II

HI, 

We are working on IMXRT 1050 EVEB. Originally this board was Hyper flash we have changed this board to support QSPI.

We are taking reference from example Hyeperflash with SDK_2.9.1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\flexspi\hyper_flash\polling_transfer.  This example we have modified for external QSPI interface with flexspi using Linker file MIMXRT1052xxxxx_flexspi_nor.icf.

We have modified linker file to work this as below, 

shaileshnsec_0-1640781510430.png

 

With above changes Read and write from external Nor flash connected with FLEXSPI is working on IAR IDE. But same change we have ported to eclipse with cmake but it is not working seems when we try to configure FlexSpi register then system crashes.

I found some difference object file generated by eclipse with cmake and IAR. IAR is generating fsl_flexspi.o object file where as Eclipse with cmake is generating fsl_flexspi.c.obj(that is 3D object file). 

Is this object will have any impact on FlexSpi ?

 Do you have example with cmake in eclipse ?

Please help us to resolve this issue..

0 项奖励
1 解答
1,589 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Please refer to the linker file to implement relocate the FlexSPI driver into the RAM.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
5 回复数
1,690 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) Is this object will have any impact on FlexSpi?
-- From the function point of view, these two kinds of objects are the same.
2) Do you have example with cmake in eclipse ?
-- The linker file is suited for the Eclipse, which can relocate the FlexSPI driver into the RAM, please refer to it for details.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
1,657 次查看
shaileshnsec
Contributor II

Hi,

We have modified FlexSpi NOR linker file. We are using eclipse IDE with Cmake. Here Qspi.c is calling some API from FlexSpi.c. We have seen QSPI and FlexSpi object file is correctly moved to RAM location. Now FlexSpi Initialization is successful without any crash. But when try to read Device ID of QSPI it hangs on API  QspiFlash_GetVendorId(..).

Linker file modification : 

shaileshnsec_3-1641290595564.png

 

Code flow -> 

static void TestCaseInitVerify(void)
{
bool bValue = false;
// Initialize the flash.
QspiFlash_Init();   // This is defined in QspiFlash.c which calls FlexSpi_Initialization()  // **This init is success

// Get vendor ID.
QspiFlash_GetVendorId(&vendorID); // This is defined in QspiFlash.c // **It shows below message

shaileshnsec_1-1641290378995.png

 

} /

When I stop debugger it shows below message in disassembly when it JUMPS to NOR location.

shaileshnsec_2-1641290546079.png

Please let us know where is the issue?

0 项奖励
1,641 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
As the below figure shows, the QspiFlash_GetVendorId() function still resides in the QSPI instead of the RAM actually, and it's the root cause of the above failure.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 项奖励
1,621 次查看
shaileshnsec
Contributor II

Hi,

I have checked API QspiFlash_GetVendorId(..) is located to RAM location as well. I have attached screenshot(Intentionally called before to QspiFlash_Init to verify whether it enters to RAM). 

shaileshnsec_0-1641449890996.png

Problem is when QspiFlash_Init() API is called, seems it does not comes out of RAM location correctly. So it does not go inside QspiFlash_GetVendorId() and show below message. 

shaileshnsec_1-1641450070848.png

More information on relocation from RAM to NOR and Vice-versa.

shaileshnsec_2-1641450361724.png

Please let us know where is the problem??

 

0 项奖励
1,590 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
Please refer to the linker file to implement relocate the FlexSPI driver into the RAM.
Have a great day,
TIC

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励