Dear team:
My project runs normally in flash. But after I copy part of the program into H0SARAM, as long as the program runs into H0SARAM, it will enter an illegal interrupt (the interrupt is shown below).interrupt void ILLEGAL_ISR(void) // Illegal operation TRAP
{
// Insert ISR Code here
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
asm(" ESTOP0");
for(;;);
}
But if I copy the same program to L0SARAMA, it will not work properly. Is it because H0SARAM can't copy programs in the past? Below is the copy program:KickDog();
// Initialize the PLLCR to 0xA
InitPll(0xA);
/* Copy the secureRamFuncs section */
memcpy(&FLASH_SET_FUNCS_runstart, &FLASH_SET_FUNCS_loadstart,
&FLASH_SET_FUNCS_loadend - &FLASH_SET_FUNCS_loadstart);
/* Initialize the on-chip flash registers */
InitFlash();
// Initialize the peripheral clocks
InitPeripheralClocks();
This is the CMD file:
PRAMH0 : origin = 0x3F8000, length = 0x002000 /*used as program segment*/
FLASH_SET_FUNCS : LOAD = FLASHCD, PAGE = 0
RUN =PRAMH0 , PAGE = 0
RUN_START(_FLASH_SET_FUNCS_runstart),
LOAD_START(_FLASH_SET_FUNCS_loadstart),
LOAD_END(_FLASH_SET_FUNCS_loadend)