BillW says: Try a different compiler. It's amazing how many bugs show with
different compilers. Some show up just because compilers have different ideas
about how strict they should be about certain types of possible errors. Others
show up when storage is allocated differently, or similar...
Includes most popular JTAG port pinouts.+
The ten secrets of embedded debugging
Here is a quick redux:
Know your tools "When all you have is a hammer, every problem
looks like a nail."
Source code debugger lets you step through your code, stop it, and
then examine memory contents and program variables.
printf or LEDs are flexible, primative, clumsy and intrusive.
In-circuit emulators (ICE) and JTAG debuggers allow you to
carefully control the running chip. Hardware emulators aren't the same as
the production CPU.
Data monitors show you what your variables are doing without stopping
Operating system monitors display events, such as task switches, semaphore
activity, and interrupts.
Profilers measure where the CPU is spending its cycles.
Memory testers search for problems in the use of memory.
Execution tracers show you which routines were executed
Coverage testers show you what code is being executed.
Find memory problems early "Memory problems are insidious."
Optimize through understanding
"...trim the fattest hog first"
"making the code run fast is the easy part. The hard part is knowing which
code to make run fast."
"performance profiling is simple and powerfull."
"...the Heisenberg effect of your profiler: every measurement changes
the system. "
Don't put needles in your haystack
"...that nagging feeling that they're cutting a corner and creating a
bug for the future. Stop and listen to your inner voice!"
"Twenty-Five Most Common Mistakes with Real-Time Software Development"
Reproduce and isolate the problem
"If you do end up with a needle, divide the haystack."
"An organized, meticulous approach is critical to isolating the
Know where you've been "Use a source control system"
Make sure your tests are complete "Coverage testing should be part
of every quality assurance process."
Pursue quality to save time "...it costs 10 to 200 times more to
fix a bug at the end of the cycle than at the beginning."
See, understand, then make it work
"debuggers deal only with static values of stopped programs."
"Real-time monitors answer the dynamic performance questions."
Harness the beginner's mind "The "beginner's mind" is a Zen concept
of emptying your mind so it can be open to new solutions. The power of the
beginner's mind should not be underestimated. A fresh pair of eyes can work
wonders. Even a truly empty mind, such as a manager's, can help. "
Know your tools
| ||©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/method/debug.htm"> Debugging</A>
PICList 2017 contributors:
List host: MIT,
Site host massmind.org,
Top posters @20171020 RussellMc, Van Horn, David, James Cameron, Sean Breheny, IVP, alan.b.pearce, Neil, David C Brown, Bob Blick, Denny Esterline,
* Page Editors:
Roman Black of Black Robotics
donates from sales of
stepper controller kits.
* Ashley Roll of Digital Nemesis
donates from sales of
RCL-1 RS232 to
* Monthly Subscribers:
on-going support is MOST appreciated!
Richard Seriani, Sr.
Welcome to www.piclist.com!