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

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

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

979 Views
terrybogard
Contributor II

Hi NXP experts,

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

Thanks.

0 Kudos
1 Reply

967 Views
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 Kudos