AnsweredAssumed Answered

Coldfire V2: Porting to EWL from MSL crashes application

Question asked by Bhavya C on May 8, 2014
Latest reply on May 20, 2014 by Bhavya C

Hello,

 

I was working on a V2 Coldfire controller (MCF5216) with Codewarrior v5.9 (Classic IDE) which is a pretty old one.

I am trying to port my application to the new Codewarrior v10.6 due to some license/support issues with win-7 and so far I have been unsuccessful.

The behavior of the code is extremely strange. With the debugger connected to the system, the code runs smoothly sometimes and hangs sometimes. This seems to happen at every alternate attempt to debug!

Also, after flashing the code, once the board is powered down and then powered up again(without the debugger connected), it doesnt do anything it is supposed to (Ex. clicking relays, switching LEDs etc.).

I have checked and re-checked my compiler/linker settings in the new IDE but nothing seems to work. (it works beautifully with the CW v5.9 though).

 

I have tried to see what the cause could be while debugging.

When hanged, on stopping the execution, the debug window shows the current point to be sometimes at the Illegal_Instruction_Exception, sometimes at the Access_Error_Exception and sometimes at an unmapped memory region.

The stack frame gives me information on from where the cpu went haywire, but it is always at a different point each time.

But, on examining the disassembly, the instruction pointed to by the stack-frame is either

MOVE.L (-0010,A6),D0

 

or

MOVE.L D0, (-0010,A6)

 

This seems to indicate that something is going wrong when either retrieving/storing something on the stack. But what?!!

The code compiles without any issues.

The only difference in the settings of the two CW versions is that the older v5.9 uses struct-alignment as '68k' and the new one (v10.6, eclipse) uses 'coldfire(long)' struct-alignment.

I also changed the struct-alignment to 68k in the new CW too, but it dint help.

 

I am clueless as to how to proceed on this; been stuck with this for quite sometime now!!.

I hope someone out there can help me out.

 

Thanks and Regards,

Bhavya

Outcomes