Programming for embedded systems has always been complicated by the difficulty of debugging embedded code, due to restricted hardware environments in comparison to most PC or workstation environments. It is possible, though, to leverage debugging efforts by utilizing hardware on the target, as well as tools generally found in a hardware or systems development lab. In this paper, I will describe some techniques for utilizing various types of hardware to help ease the software debugging burden.
Debugging can be thought of as a search for information. The primary questions to be answered include determining what the code is doing at any given, how it got to a certain point, and how long it takes to perform an operation or set of operations. The basic difficulty in answering these questions with embedded systems is that there is normally less I/O capability available. Couple this with tight timing constraints, and the result can be a nightmare.
Attempts to utilize limited I/O capabilities such as serial ports for debugging purposes are at best difficult. At worst, a sort of Heisenberg Uncertainty Principle occurs, where the attempts to characterize the behavior of the system has distorted that behavior to the point where the information obtained may be useless. This is especially apparent when debugging real-time behavior. The goal is therefore to use nonintrusive measures to obtain information about the system. Any software utilized for this purpose that uses the target system resources will inevitably perturb the system, so we will explore other means.