Reply by dp July 12, 20122012-07-12
On Jul 13, 4:15=A0am, Randy Meyers <rmeyers1...@gmail.com> wrote:
> 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] =3D 0x0. Everything is good and bootloader runs on PORESET. > > User program loaded @ 0x10000. Compiled with MSR[IP] =3D 1, BBCMCR[ETRE] =
=3D
> 1, and BBCMCR[OERC] =3D 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.
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 http://www.tgi-sci.com ------------------------------------------------------ http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/
Reply by Randy Meyers July 12, 20122012-07-12
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.