Question 1:
Hi, I use MK64FX512, now I want to divide the program space into two blocks, the first block is located in 0x00-0x2ffff, the second block is located in 0x3000-0x80000, jump from the first block to the second block with the following program:
typedef void (*iapfun) (void);
iapfun jump2app;
void msrmsp (unsigned int addr)
{
__asm volatile (
"MSR MSP, r0 n"
"BX r14 n"
);
}
void iap_load_app (unsigned int appxaddr)
{
unsigned long tmp;
tmp = (*(volatile unsigned int *)appxaddr) & 0x2ff00000;
tmp = tmp;
if (tmp == 0x20000000) {
jump2app = (iapfun)*(volatile unsigned int *)(appxaddr + 4);
msrmsp (*(volatile unsigned int *)appxaddr);
jump2app();
}
}
Call iap_load_app (0x3000), 0x3000 already have a program, the above program is no problem to use in M4 of ST and TI, but the program of the 0x3000 cannot be run in MK64.
Question 2:
CAN THE PROGRAM RUN 0x10000000 SECOND FLASH?