ram/rom/bdm behaves different mpc555

Henning Baldersheim henning.baldersheim@devoll.no
Sat Feb 21 10:00:00 GMT 2004


Hi

I am trying to adapt ecos to a mpc555 card from Phytec. I by looking at the 
ports for ec555 and cme555 by Bob Konix and with the board specific 
instructions.
I think that I understood the structure and how things where done. I was 
able to get things working and has done some testing and debugging with 
Redboot.

Hovever some problems have occurred that I still do not have any answer to. 
They seem a little mysterious too me. I have used a BDM with both ocd_cmdl 
from macraigor and a combination of gdb 6.0 and ocdlibremote from the same, 
today I also tried the codewarrior.

1 - RAM startup. With the modified startup taken from ec555 it worked when 
single stepping the startup code and then run, but when just run it failed. 
After trying with stting a breakpoint at different places I figured out 
that there was a vulnerable point. Setting a breakpoint at line n and 
continue twice worked. If I moved breakpoint to n+1 or later It never 
reached this place. Then I just added 1 instruction in between -> 
everything is fine. But I do not understand why. Here is the code
hal_hardware_init:
	lwi         r3, CYG_ARCH_IMMR_BASE
	sync      //Added -> Makes it work, but have no clue why.

	// Burst enable
	lwi        r0, 0x2000
	mtspr    560, r0
Anyone any clue.

2 - ROM startup. After testing RAM with both -O0, -Os and -O2 and testing 
flash programming with and without gzip I progressed to ROM startup. 
Flashing went well. But It did not work. But after some debugging, I 
realized that If I ram part of the code through ocd_cmdl and their romstop 
command(uses hardware breakpoints and runs slow) it worked. If I ran it 
directly it failed and restarted. Without letting me figure out how or 
where the problem was. With gdb and ocdlibremote I was not able to set any 
breakpoint (does it not support hardware breakpoints ?). But then I tried 
with codewarrior and surprise. Here I can run it directly from start with 
no problem.

My conclusion is that the different tools do different things to the 
hardware that the initialisation code in the application do, but I am so 
far not able to figure out why. Any help/tip on this would be very helpful 
and appreciated.

Henning



More information about the Ecos-devel mailing list