MPC5xx exception table relocation

I am having trouble getting code to run when relocated in flash.

Setup; MPC565, bootloader (mine) located @ 0x0000, compiled with CW 8.1

MSR[IP] = 0x0. Everything is good and bootloader runs on PORESET.

User program loaded @ 0x10000. Compiled with MSR[IP] = 1, BBCMCR[ETRE] =

1, and BBCMCR[OERC] = 0b01. As per AN2472. Linker file adjusted to load @ 0x10000. Linker MAP shows everything where it is supposed to go. .reset @ 0x10008.

Bootloader issues 'ba 0x10008'. User program starts running and everything is fine until the OS (ucosII) issues the first 'sc' command. Program halts, I believe because it can't find the 'system_call_exception' .I should say that the user program works perfectly when compiled for and loaded at 0x0000.

I have set (or reset) MSR[IP], and the BBCMCR register values after the jump and it does not help.

My question specifically; what controls where the system looks for the exception table at? What causes the processor to say 'Oh, an 'sc' call I'll go to _____ memory location to look for the 'system_call_exception'.

Or, on the other hand, maybe I'm just going about trying to get my code started the wrong way.

Any help would be greatly appreciated.

Reply to
Randy Meyers
Loading thread data ...

=3D

The sc exception is at $c00, if this is what you are asking. If you do not have it, you probably would like to get MPCFPE32B.pdf .

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
dp

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.