This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using Linker to run Procedure in RAM

I am attempting to run code copied to RAM as outlined in AP138 but the program stops when the call is made to the copied procedure. This setup works correctly in another program. The hmemcpy appears to be OK, but the program never jumps to the flash_loader procedure. I believe that there may be a problem in the linker settings. Have you any advice on how to troubleshoot this problem?

In the calling unit:
...
extern void far flash_loader(unsigned long size);
SROM_PS (LOADER)
...
hmemcpy (SROM_PS_TRG(LOADER), SROM_PS_SRC(LOADER), SROM_PS_LEN(LOADER));
flash_loader(psize);	// <-- Program stops here
...

The loader unit:
#pragma RENAMECLASS (FCODE=FLASH_CODE)
...
void flash_loader(unsigned long size) {
	// Never gets here
}


Linker Settings:
User Classes     SROM (0xC00000-0xC1FFFF)
User Sections    ?PR?LOADER%FLASH_CODE (0x41D000)[!]

Thank You

0