Boot RT1052 from QSPI and execute from ITCM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Boot RT1052 from QSPI and execute from ITCM

4,606件の閲覧回数
carlosflr
Contributor II

Hi,

We designed a board with an RT1052 (MIMXRT1052DVJ6B) and QSPI (IS25WP064A) but we are having problems to boot our code.

We would like to run the code from ITCM for improved performance, using a configuration for ITCM/DTCM/OCRAM of 256K/192K/64K (or 256K/128K/128K if the previous configuration is not possible). We have tried for several days to achieve this following several application notes and community forum posts with no success. We put a breakpoint in ResetISR, start a debug session (via SWD) and the processor is lost apparently in BootROM (doesn't reach ResetISR).

Is there a demo using the IMXRT1050-EVKB that does something like this? Or do you have some ideas?
We have used these references:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Reallocating-the-FlexRAM/ta-p/1117649

https://community.nxp.com/t5/MCUXpresso-IDE/Program-not-reaching-ResetISR-appears-to-be-stuck-in-BOO...

https://www.nxp.com/docs/en/application-note/AN12077.pdf

 

Best regards,

Carlos Lopez

タグ(3)
0 件の賞賛
返信
12 返答(返信)

4,469件の閲覧回数
jc_pacheco
NXP Employee
NXP Employee

Hi Carlos, if you are using the QSPI flash instead of the Hyperflash, don't forget to adapt the flash driver and flash configuration block to meet the QSPI memory configuration... Otherwise your application won't leave the BootROM. See:

How to Enable Boot from QSPI Flash

You could also take "xip/evkmimxrt1060_flexspi_nor_config.c" from RT1060 as reference... it uses the same QSPI by default.

I also recommend to keep an issue per post to avoid handling different issues in same thread.

0 件の賞賛
返信

4,519件の閲覧回数
carlosflr
Contributor II

We used a hello world sample project from the 2.9.1 SDK, made the required changes and it worked. So, I guess I must have something wrong in our original project (hard to find, though).

I'm attaching the hello world running from 256KB of ITCM in case this is useful.

Thanks a lot for your prompt replies.

Regards,

Carlos Lopez

0 件の賞賛
返信

4,516件の閲覧回数
crist_xu
NXP Employee
NXP Employee

Hi,

      From the startup_mimxrt1052.c: 643 in your attached file, I saw that you comment the stack setting,


 
Updating Media

 

but seems that, you did not re-configure the MSP after. Do you set this MSP other location?

 

Regards,

      Crist

タグ(1)
0 件の賞賛
返信

4,491件の閲覧回数
carlosflr
Contributor II

Hi Crist,

We used this as a reference:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Reallocating-the-FlexRAM/ta-p/1117649

In the code snippet in that link they don't have this stack setting. Is it needed?

Also, we don't have an NCACHE region in our project (we think it's not needed) and commented out some related code in BOARD_ConfigMPU. Can you please let me know if this is OK?

Thanks for your help!

Carlos

0 件の賞賛
返信

4,482件の閲覧回数
crist_xu
NXP Employee
NXP Employee

Hi Carlos,

      About the stack, if you want to reset the SP to a different one(FlexRAM and Linker Problem - NXP Community), you need to configure it. But if not, i think you can double check the SP value when the code run to the ResetISR.

     About the MUP, i think that the non-cache area will not affect your code, if you do not need the non-cache area. That means you do not need any cache-maintenance operations in your project.

    If it is possible to simplify you code, or maybe just preserve the some test codes? I think it will be more helpful to find the root cause.

Regards,

     Crist

0 件の賞賛
返信

4,529件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi carlosflr,

 1. About the RT1052 FlexRAM configuration, you can refer to AN12077:

https://www.nxp.com/docs/en/application-note/AN12077.pdf

image.png

image.png

So,  ITCM/DTCM/OCRAM of  256K/128K/128K is Ok, but 256K/192K/64K  can't be used.

Even you use ITCM/DTCM/OCRAM of  256K/128K/128K, you need to reconfigure the flexRAM.

As the default one is ITCM/DTCM/OCRAM of  128K/128K/256K.

If you are using the MCUXpresso IDE, you can refer to this post:

https://community.nxp.com/t5/i-MX-RT/FlexRAM-and-Linker-Problem/m-p/990512

You need to add the code and modify the scp file.

About run in the internal ITCM, you just need set the project run from RAM, and in the memory configuration, the first item is using the ITCM.

More details, you can check the question post which I share with you.

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

0 件の賞賛
返信

4,490件の閲覧回数
carlosflr
Contributor II

Hi Kerry,

Thanks for your detailed reply.

We followed those references in a sample project and it worked. For some reason our project did not work when following those steps, as mentioned in my first post (it gets losts in BootROM).

What we plan to do is to use the sample project as a base and add our sources to it.

Best regards,

Carlos Lopez

0 件の賞賛
返信

4,452件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi carlosflr,

  Thanks for your updated information.

   Some question confirm with you.

  1. Your own designed board, if no flexram modification, whether it works ok or not with the QSPI flash?

   2. When run the SDK simple project with the flexRAM modification, it works? And just use your own project, it can't work?

   You can use the simple working project as the base, then add your own code part by part, and test it.

  Any updated information on your side, please kindly let me know.

Kerry

0 件の賞賛
返信

4,544件の閲覧回数
crist_xu
NXP Employee
NXP Employee

Hi Carlos,

         It's better to attach a simple project, or you can delete all the other files and only remain some test codes that can reproduce the errors. And which IDE you use? Seems that you use MCUXpresso, and my mainly IDE is Keil? So, the Keil project is OK for you, and i can try to build a project for you.

 

Regards,

          Crist

0 件の賞賛
返信

4,571件の閲覧回数
crist_xu
NXP Employee
NXP Employee

hi,

     Could you please attach the code or show detailed of what you want to do? I think you want to boot XIP, and then run some code in ITCM, not all the code, right? 

0 件の賞賛
返信

4,563件の閲覧回数
carlosflr
Contributor II

Hi Crist,

Thanks for your reply.

I cannot attach our code in a public forum. Let me see if I can replicate the problem in a sample project.

About your question, we want to run all our code from ITCM. Our entire application fits in 256KB. So, we would like the bootloader to copy the code from QSPI to ITCM and run from there.

I think I'm mixing two issues. We should try to do this first with the default ITCM configuration and then when this works increase ITCM space. Do you have a small example that loads QSPI to ITCM and run from there?

Thanks,

Carlos

0 件の賞賛
返信

4,536件の閲覧回数
crist_xu
NXP Employee
NXP Employee

Hi, Carlos      

       It's better to attach a simple project, or you can delete all the other files and only remain some test codes that can reproduce the errors. And which IDE you use? Seems that you use MCUXpresso, and my mainly IDE is Keil? So, the Keil project is OK for you, and i can try to build a project for you.

 

Regards,

      Crist

0 件の賞賛
返信