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...
Also:
See also:
-
http://hackaday.com/2016/12/15/the-many-faces-of-jtag/
Includes most popular JTAG port pinouts.
-
http://www.embedded.com/showArticle.jhtml?articleID=47208538
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
the system.
-
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!"
-
http://www.embedded-zone.com/esc/mistake.pdf
"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
problem."
-
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