How to run all the code in the PSRAM?

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

How to run all the code in the PSRAM?

1,276 Views
Wayne2
Contributor II

Hi NXP team

We want to run the code in the PSRAM in mxrt595 board. 

We choose "Link application to RAM", it works well in the SRAM. And we refer the evkmimxrt595_sdcard_fatfs_freertos_Debug.ld file, change the SRAM to RAM_00, the RAM_00 is PSRAM. But it can't work after modification.

The user guide only has how to move the code or library to the RAM, I can't find some method about PSRAM operation.

Wayne2_0-1672023120736.png

 

Tags (1)
0 Kudos
Reply
5 Replies

1,261 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Wayne2 ,

Yes, the code can run in PSRAM. But the problem is RT500 access PSRAM via flexspi and flexspi need to be initialized before download code to PSRAM. The debug script and flash algorithm doesn't support that. You have to make a PSRAM algorithm or PSRAM initialize script by yourself.

 

Regards,

Jing

0 Kudos
Reply

1,247 Views
Wayne2
Contributor II

Hello @jingpan 

I used the IDE tools to move the my own heap to the PSRAM was successful.

And I also added the initialization of the PSRAM in the main function.

But I am still confused about make PSRAM algorithm or PSRAM initialize script, could you give

me some examples?

Thanks a lot!

Wayne2_0-1672281539663.pngWayne2_1-1672281552577.png

 

0 Kudos
Reply

1,242 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Wayne2 , 

If you want to download code to PSRAM, of course the PSRAM should be ready. Otherwise any PSRAM operation (R/W) will fail. The flash algorithm is used to configure flash and help to download code to flash. You can also add PSRAM initialize function to it. The source code is in C:\NXP\MCUXpressoIDE_11.6.0_8187\ide\Examples\Flashdrivers\NXP\iMXRT

I think there is another way to get around. You can download a PSRAM initializing application to flash. Let it run first to initialize PSRAM, then if the flexspi port is not reset, it is possible to download new code to PSRAM by debug probe. 

 

Regards,

Jing

0 Kudos
Reply

1,240 Views
Wayne2
Contributor II

Hi @jingpan 

I have uploaded my ld file, RAM_00 is my PSRAM , I have used the RAM_00 instead of the SRAM.

Wayne2_0-1672305000769.png

If I debug the project, it block at the ResetISR.

Could you help me to check my ld file? 

Thanks!

Wayne2_1-1672305085845.png

 

 

0 Kudos
Reply

1,205 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Wayne2 ,

The problem is not ld file. The problem is flexspi1 and PSRAM is NOT initialized before you download code to PSRAM. You can see in the right window that PSRAM is empty, all zero.

You have to make a script to initialize PSRAM.

Regards,

Jing

0 Kudos
Reply