Loading the Application to PSRAM and Run

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi Sir/Madam,
I am Working on XMC4200 my requirement is Run the Application from PSRAM after user input signal, Let us say application is Running From Flash and user sends signal,
Then the already stored code should be Loaded Into PSRAM and need to Run.

in order to achieve i have done the following procedure.

1) i have taken a simple LED blink program and Converted to array format using bintohex.exe

2) waiting for the user signal

3) when ever i got the signal i am copying the (LED Blink array) to PSRAM location From 0x1FFFC000 ( verified with memory window the entire array was loaded success fully)

Please Let me know is the above procedure is Correct ?? if Correct Please guide me how to run the code.

if the above procedure was Wrong then guide the right procedure to full fill my requirement.

Note: Signal Refers Interrupt.

Thanks and Regards,
Harshan
0 Likes
2 Replies
Rick_Nardone
Employee
Employee
Hi Harshan,

You can have a function execute from SRAM by using the following attribute:
/* functions with __attribute__((section(".ram_code"))) */

This might be one possible solution for your request.

Best,

Rick

0 Likes
Not applicable
Hi RickNardone,
Thanks for Reply, as per my understand of you reply let me conclude.

while defining the Function i need to provide " __attribute__((section(".ram_code")))" attribute so that it will store in flash, and when Executing the code will be copied into SRAM and will Run from it.

Thanks and Regards,
Harshan.
0 Likes