Unexpected Program code Restart

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

Unexpected Program code Restart

3,446 Views
bepade1
Contributor I
Hello,
 
I am experiencing software reset during code execution (both while debugging or not). My target MCU is a MC56F8345 with COP not enabled, and no spurious HW reset due to noise or other board problems.
 
I suspect stack overflow, too much interrupts  or memory corruption due to some coding mistakes but I don't get any warning message from CW7.3 when the problem occur . Program execution simply restart..
 
Could you please give some hints how to trace the exception causing the code reset from CW?
 
Thanks
 
 
Labels (1)
Tags (1)
0 Kudos
Reply
4 Replies

1,113 Views
bepade1
Contributor I

Hi Tom,

The restart was caused by several interrupt sources which were enabled in Processor Expert  Beans (internal peripherials) but not used by the application code. Since our application is very intensive interrupt driven due to realtime needs, those unexpected interrupt calls were causing code restart. So please becarefull when several programmers are working on the same project and add beans...

However, I am still wondering how to setup in CW a trace log on program flow occured before a breakpoint is reached. Do you know a reference to a white paper or a manual?

Thanks for you help,

Paolo

0 Kudos
Reply

1,113 Views
bepade1
Contributor I

Hi Tom,

Unfortunately, I've  searched the whole project directory for a file name sta*.* but didn't found any match. The project has been created  by means of  Processor Expert Stationery and is > 10.000 C code lines...

Any idea?

Best regards,

Paolo

0 Kudos
Reply

1,113 Views
J2MEJediMaster
Specialist I
I tend to not use Processor Expert for various reasons. Not that it's bad, but I like to set things up myself, where possible. If Processor Expert was used, look for a Cpu.c file. This file is generated by Processor Expert and contains the initialization code. The vector table for the reset vector (in vectors.c) should reference _EntryPoint, which is the initialization routine in this file. You may want to trace the program flow from there.

---Tom
0 Kudos
Reply

1,113 Views
J2MEJediMaster
Specialist I
If you're using one the projects generated by the CW project wizard, there should be a file named startxx.c or startxx.asm that performs all of the low-level processor initialization such as stack setup and high-level language run-time initialization. You might try placing a breakpoint in there and watching what happens. If you've written your own low-level initialization code, place a breakpoint in that.

---Tom
0 Kudos
Reply