Function call in Ram area

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Function call in Ram area

1,311 次查看
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 项奖励
回复
1 回复

1,308 次查看
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 项奖励
回复