Debugging Techniques for bug finding??

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

Debugging Techniques for bug finding??

349 Views
sanketkulkarni
Contributor III

I am writing this to ask regarding the methods to find a bug fast. For this I would like to mention a case which I want to solve from 2-3 months.

We have Our meters based on MK20 series controllers. Meters behave absolutely well. But there is case when sometimes it restarts after every predefined time which may be due to watchdog. But this is very very rare event. 

      One Meter came to me from feild, I tested it for 2 days but this event came only once, after that it didnt came and we returned the meter with fresh firmware. But knowing the problem is unsolved.

     So, I am curious to know that how to solve this issue?? 
   So, it is is my request to guide me with a case study so that it can help me to solve the problem. For eg., Read the .MAP file or some code in DEBUGHAULT may help or some other things which go really deep inside to solve the issue.

Tags (1)
0 Kudos
1 Reply

247 Views
BlackNight
NXP Employee
NXP Employee

When I had such things, my first goal was always to understand what is causing the problem. What you describe could be not only a bug in your software (memory leak? dangling pointer?) but as well some hardware/silicon issue (power supply stability? Brown outs? Electromagnetic noise? Problems with the interrupt line (pull-up not strong enough), etc).

If you believe it is the watchdog or whatever you think it could be: collect data to prove your point. For example have a small ring buffer where you store the data (e.g. from the interrupt) and when you come out of reset, read that data (before it is overwritten by the startup code).

Record as much information as possible. I hope you have the trace pins available, so you could do a hardware trace with a trace probe (see Tutorial: Getting ETM Instruction Trace with NXP Kinetis ARM Cortex-M4F | MCU on Eclipse ).

Or use a software ring buffer e.g. with a software/RTOS trace so you get a post mortem trace (search for 'post mortem' in McuOnEclipse Components: 12-Dec-2016 Release | MCU on Eclipse  or in McuOnEclipse Components: 3-Apr-2016 Release | MCU on Eclipse ). You could use some kind of data logger attached to the system too.

I hope this helps,

Erich

0 Kudos