locate a hex into RAM

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

locate a hex into RAM

2,431 Views
yin_qiu
Contributor III

dear NXP experts:

I have a question about ram code:

I want to download a "fct.hex" into RAM and jump into the "Fct.hex" to run the dedicated function.

because there is pure free memory only in DTCM and last 32K "int_sram_shareable " in bootloader. so I think the FCT.hex can only be placed in the two areas. 

so I modify the link file as attached. and the final hex is show as picture below.

after I debug the hex by PE it failed in the function that located in the second block.

if I do not split the hex into two blocks and it works OK if the whole hex is located in DTCM.

I  also try to take use of ".ROM.fct_text ROM(.fct_text)" and add a copy table in "init_table" which is in startup_cm7.s but it still failed.

 

could you pls help me and thank you very much.

yin_qiu_0-1734681454400.png

yin_qiu_1-1734681470625.png

 

yin_qiu_2-1734681488570.png

 

0 Kudos
Reply
3 Replies

2,331 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am bit confused.

But you have to place the code in to RAM section and then make sure once it is loaded in uC, you copy that section in your SW into RAM during initialization.

After that you can use that function in RAM.

There are lot of examples is S32DS for execution from RAM.

Best regards,

Peter

0 Kudos
Reply

2,326 Views
yin_qiu
Contributor III

hello :

thank you for reply and I find the root cause that the "__INT_SRAM_END" is set to ram_rsvd2.so once the SW runs ,the contents located in "int_sram_shareable" will be erased by startup code.

I modify the "linker_flash_s32K312.ld " to make it work as "inker_sram_s32K312.ld" do. so the code runs in sram without copying from pflash to sram.

Tags (1)
0 Kudos
Reply

2,413 Views
yin_qiu
Contributor III
I think the modification of the ld file is correct but I debug the elf by PE, the contents of the second block of the hex is not download in MCU RAM.
0 Kudos
Reply