MC5682758 , Is there demo code about how to copy code into RAM and running in RAM?

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

MC5682758 , Is there demo code about how to copy code into RAM and running in RAM?

1,474 次查看
terrybogard
Contributor II

Hi NXP experts,

Is there demo code about how to copy code into RAM and running in RAM?

Thanks.

0 项奖励
回复
1 回复

1,462 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Terry,

I think you can refer to the Flash example based on PE for MC56F8013, I attach the example here.

#pragma define_section RAW_PROG_FLASH_section ".RAW_PROG_FLASH" RX
#pragma section RAW_PROG_FLASH_section begin
static asm void Run_and_wait_in_prog_flash(IFsh1_TAddress address, word data, word command)
{
move.l A10,R2; /* Move given address to pointer register */
move.w Y0,p:(R2)+; /* Write data to the address in program memory */
move.w Y1,FMCMD_ASM;
move.w #$80,FMUSTAT_ASM;
wait:
moveu.w #$f020,R0;
adda #$3f3,R0,R0;
move.w X:(R0),A;
bftstl #$40,A1;
bcs wait;
rts;
}
#pragma section RAW_PROG_FLASH_section end

0 项奖励
回复