Function call in Ram area

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

Function call in Ram area

850 Views
MyeongGeunChoi
Contributor I


hi.

I am using s12z 192 mcu and have a question.

I want to run all the code in the ROM area in the RAM area. (Rom: 0xFD0000 ~ , RAM: 0x1000 ~)

It was confirmed that the code in the rom area was copied to the RAM area, and the main function copied from the rom to the ram was called and operated. Call using ram's address, use __asm(jmp)

The problem is that the operation of other functions called from main function in Ram area is executed in Rom. Probably, because a function with the same name exists in the Rom area, it seems that the function in the Rom area is called. 

How can I make a function called in Ram area work in Ram area? (Since it was copied from the ROM area to RAM, the function with the same name exists in the ROM and RAM area.)

 

please answer about my question. Thank you.

0 Kudos
Reply
1 Reply

847 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Please take a look at this example:

S12Z Flash example code

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Flash-example-code/ta-p/1108954

In flash_S12Z.c, the function PFLASH_Send_Command() is placed in SRAM.

 

Regards,

Daniel

0 Kudos
Reply