MCF5235 Flash Execution Problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MCF5235 Flash Execution Problem

1,122件の閲覧回数
aergin
Contributor I

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

ラベル(1)
0 件の賞賛
返信
1 返信

710件の閲覧回数
ChrisJohns
Contributor I

You could try and set a hardware break point on an instruction around there and then single step at the instruction level.

 

BDM supports debugging flash problems this way and I assume the Codewarrior tools can handle this (I am not a Codewarrior user, rather a GDB and BDM user (developer)).

 

If you get to the breakpoint I would check your RAM memory map is what you expect, eg stack, .data, .bss and heap.

 

I would also check interrupts are being handled correctly. It could be an interrupt occurs at the same point in time after reset and so it appears like the code is broken but it is ok. BDM single stepping instructions will mask interrupts.

0 件の賞賛
返信