Program Exception in MPC8572

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

Program Exception in MPC8572

1,376 Views
sarav
Contributor I

Hi,

We are facing a program exceptionat at a critical stage of our project.

The details are as follows:

 

CW debugger USB Tap

OS : VxWorks

Board : MPC8572AMC

 

When i go to the exception address pointed by the CIA i can see that the opcode is all zero and debugger displays it as "Invalid Opcode". This address changes for every time.

 

Since this project is a integrated from several modules, we are not in a position to do code review.

 

Is there any tip or trick to detect who is corrupting the program memory?

 

I tried setting watchpoints but CW aborts.

 

I would appreciate any early reply on this.

 

Thanks,

Sarava

Labels (1)
0 Kudos
4 Replies

422 Views
ronco
NXP Employee
NXP Employee

Hi Sarava,

You didn't say whether you're debugging a VxWorks kernel or application.  Debugging a VxWorks application in the CodeWarrior debugger is more difficult because the kernel dynamically loads each app at run-time and the CodeWarrior debugger does not have a VxWorks kernel plugin that tracks these loads.  That said, Power Architecture Exceptions are usually located in stable addresses but the pointers to those addresses can change.  Check the IVPR and IVORxx registers and see if any combination of IVPR+IVORxx points to your zeroed address.  Also, check the SRR0 and SRR1 registers (and CSSR0 and CSSR1 if appropriate) for clues on what caused the Exception and what your code was doing when it occurred.  Refer to the MPC8572 Reference Manual for details.

Your comment about WatchPoints causing CodeWarrior to abort concerns me. I can think of no reason for that to happen.  I suggest you create a File->New->EPPC New Project Wizard project, debug it on your board and see if WatchPoints cause the same behavior.  Regardless, if the problem continues please start a new Service Request by logging on to your "My Freescale" account at www.freescale.com and clicking on Enter a Service Request so we can investigate further.  I hope this helps.

-Ron

0 Kudos

422 Views
sarav
Contributor I

Hi,

Thanks for your reply.

 

We are debugging a VxWorks SMP application.

Well, all the registers become zero at this point and i am unable to see any values in them. (We have placed a breakpoint in the exception handler routine and trying to look at the state of the registers)

 

Regarding Watch points, yes i have raised a service request earlier and waiting for reply.

 

Since the program exception address changes randomly, we have to place a watchpoint for entire memory range covering the whole program memory.

 

I am not sure how to turn on such feature in Code Warrior even though the help manual says watchpoint can be put for vairable or for memory range.

 

Thanks,

Saravana

0 Kudos

422 Views
ronco
NXP Employee
NXP Employee

Are you saying that ALL MPC8572 registers, in both cores, become zero?  That would indicate a fundamental debugging problem that should be investigated independently.  I see that you have an SR ending with 8874 which I will look into.

 

I can address the Watchpoint-across-memory-range question.  There is a trick to setting that up which may make it difficult to do across a large address range.  Start by opening a Memory Window at the starting address of your Watchpoint.  Click on the data value at that address, hold down the Shift key then (here's the trick) right-click on the ending value of your Watchpoint address range and select "Set Watchpoint".

 

Regards,

Ron

0 Kudos

422 Views
sarav
Contributor I

Hi,

Thanks for your reply. 

 

Sorry about that register zero phrase. It was a wrong information.

 

What i meant is that the opcode at the program exception address CIA register shows a valid program memory region and when we look at that place we could see that opcode is zero.

 

This program exception address changes with every run.

 

I am also considering changing the MMU options in the BSP in such a way that RAM section is split into two sections. One section attributes will be set with read only and the other with all permissions.

We will be modifying the linker scripts to place the text segment in the read only memory and all other sections in the other section.

 

Meanwhile we shall try the trick suggested by you. However as it looks it might be difficult to select the complete program memory.

 

Yes i have raised that service request.

 

Thanks, 

Saravana 

0 Kudos