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.
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
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.