Unused bits in a program counter should be zero. However, sometimes they are not. And in fact, since the bits are unused, their value does not matter, as long as nobody from the outside, such as a debugger, reads them. So, can this cause problems for AVR microcontrollers?
Continue readingTag: debugging
AVR TQFP-100/64 Test and Programming Sockets
When you are working with ATmegas in TQFP packages, one of the really helpful things is a test socket, as shown in the picture above.
Continue reading
A Comprehensive List of AVR Debug Probes
Have you ever wondered if you could use the AVR debug probe you found in your Grandpa’s spare parts box to debug your latest hardware project? Here comes the comprehensive list of AVR debug probes, which will answer such questions.
Continue readingAs soon as we started programming, we found to our surprise that it wasn’t as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
(Maurice Wilkes, 1949, architect of one of the first stored-program computers)
System View Descriptions of AVR MCUs
What is a system view description (SVD)? What can it be used for? And what is the connection to AVR microcontrollers?
Continue reading
Stop-and-Go
One typical debugging activity is setting breakpoints and then running the program from breakpoint to breakpoint, inspecting the program’s internal state at each breakpoint. While this sounds simple, it gets complicated when one looks behind the curtain, which we will do in this blog post.
Continue reading
Interrupted and Very Long Single-Steps
It often happens in embedded debugging that you suddenly end up in the interrupt dispatch table while single-stepping through your code. Another unrelated problem is that sometimes, single steps can take an eternity. In this blog post, I address both issues and describe how to circumvent them in a gdbserver implementation.
Continue reading
Volatility, Race Conditions, And Heisenbugs
What is the purpose of the C++ qualifier volatile? What does it have to do with race conditions, and what are Heisenbugs?
Arduino IDE 2 Meets dw-link
Debugging classic AVRs in the Arduino IDE 2 is finally possible! It took a while to implement this feature, but now it is just a piece of cake to enable debugging and start using the debugger.
Continue reading
Spontaneous MCU Restarts: Why Do They Happen?
AVR MCUs sometimes appear to restart without you having pressed the RESET button or any other obvious reason. Is that a sign of resilience or of looming danger? How can you find the root cause?
Continue reading