James Kime

MCF5235 Flash Execution Problem

Discussion created by James Kime on Feb 2, 2010
Latest reply on Feb 3, 2010 by Chris Johns

I am having a strange problem in my code.  I can run my code perfectly out of RAM on my MCF5235 but when I install the same code in flash and start it, the device crashes.  After much debugging, I was able to find the exact spot the device is crashing and it doesnt make much sense.  It hits a spot inside of nested if-statements where it will not continue on.  I thought that it may have a problem with what is in the if-statement parameters, so I replaced them all with if(1) and I still get the same problem.  It is like it reaches a point in the code that it refuses to execute another if-statment.

 

if(1)

{

  if(1)   --CRASH HERE

  { 

  }

 

Even I add a printf or any other operation between the nested if-statments.  It still crashes at the same spot.  

if(1)

{

  printf(...)

  x = x + 1;

  if(1)   --CRASH HERE

  { 

  }

 

When I connect to the device to see where it is, it is always lost in some random memory space.  Does anyone have any suggestions or let me know if you need clarification on this problem.  

 

I am locked into using Codewarrior v6.4 for CF.  Thanks

Outcomes