Linker file configuration to allow code execution from RAM

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

Linker file configuration to allow code execution from RAM

1,265 Views
s_challa
Contributor I

Hi,

I am using S32K148 in my design. I am implementing the bootloader using CAN communication. I could get CAN communication up and running. I would like to use the same flash bank for bootloader and application code. I want to copy the code responsible for erasing and flashing the memory to RAM so that I can erase the required sectors on the flash and program the application. 

Is there any user guide available for linker configuration such that it creates the symbols for required sections of code and it allows to me to copy the code?? 

Many thanks in advance.

Best regards,

Sreekanth challa

0 Kudos
1 Reply

958 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
There is a default RAM section for storing code in RAM in the S32DS default linker file.
To place a function in RAM, use:

__attribute__ ((section(".code_ram"))) // place the function below into .code_ram section
void function(void);

Regards,
Daniel

0 Kudos