Interrupt and pointer problem with MCF52223 and CW7.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt and pointer problem with MCF52223 and CW7.1

Jump to solution
2,180 Views
skyguy
Contributor III
I'm implementing serial communications using Processor Expert beans, and have a baffling problem.  I can send and receive text, but at some point when I receive text I get a general unhandled Cpu_Interrupt.  
The sequence goes like this:
1) My program sends out an initial message
2) I send in a command string (about 30 chars)
3) The program parses the string and sends out a response (about 30 chars)
4) I repeat the command string, or send in any character
5) I get the interrupt on the first character
In my experience, these interrupts occur when a pointer is messed up, and that seems to be the case here.  I can see from the stack trace that the cpu interrupt happened while in the receiving character interrupt handler.  On examining the values of the variables, I can see that pointer InpPtrW is 0x00000001 and InpPtrR is 0x00000000.  Previously they were initialized to the InpBuffer, which is still 0x2000158A and incremented as characters were handled.  I've put breakpoints on all the places where the pointers are modified and haven't found a place where they are changed in this way. 
This acts like some uninitialized pointer is causing the memory where the pointer is stored to be overwritten, but I can't find it.  Does anyone have a similar experience or suggestions?  This is so close to working!
Thanks,
Rick
Labels (1)
0 Kudos
Reply
1 Solution
1,149 Views
CompilerGuru
NXP Employee
NXP Employee
0 Kudos
Reply
2 Replies
1,150 Views
CompilerGuru
NXP Employee
NXP Employee
Stack overflow?
0 Kudos
Reply
1,149 Views
skyguy
Contributor III
Apparently so.  I doubled the stack size and the problem went away, or at least went somewhere else.  Now I need to figure out what the proper stack size should be.

Thanks!

Rick
0 Kudos
Reply