You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learn/02.microcontrollers/04.debugging/debugging.md
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -131,8 +131,16 @@ Simulators are tools used to **simulate the functionality and the instruction se
131
131
132
132
An **in-circuit emulator** (or ICE) is a specialized tool that allows developers to examine the state of the processor while a particular program is running. ICEs are considered embedded systems by themselves; they are a copy of the target processor and its memory (RAM and ROM); this is why they provide an unintrusive way to debug code at the target processor. Historically, ICEs were the tool of choice of embedded systems developers, but as processor complexity and clock speed increased, ICEs became more expensive, and their availability declined considerably.
133
133
134
+

135
+
136
+
> [Binarysequence](https://commons.wikimedia.org/wiki/File:Microtek_8086_In-Circuit_Emulator.jpg), [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0>), via Wikimedia Commons.
137
+
134
138
An **in-circuit debugger** (or ICD) is also a specialized tool connected between a host computer and a processor for debugging real-time applications faster and easier; this tool uses some memory and GPIO pins of the target microcontroller during the debugging operations. With an ICD, developers access an on-chip debug module which is integrated into the CPU over an interface (for example, JTAG). This debug module allows developers to load, run, halt and step the processor.
135
139
140
+

***The fundamental difference between an ICE and an ICD relies on the resources used to control the debug target. In ICEs, resources are provided by the emulation hardware; in ICDs, resources are provided by the target processor.***
137
145
138
146
#### Arduino® ICD Support
@@ -177,28 +185,34 @@ Let us take a look at each one of the hardware debugging tools. A basic understa
177
185
178
186
A digital multimeter (DMM) is a hardware tool that can be used to measure two or more electrical values, usually voltage (in volts), current (in amps), and resistance (in ohms). DMMs are great tools and one of the most fundamental pieces of test equipment that can be used to debug electrical problems within an embedded system.
> [oomlout](https://commons.wikimedia.org/wiki/File:Digital_Multimeter.jpg), [CC BY-SA 2.0](https://creativecommons.org/licenses/by-sa/2.0), via Wikimedia Commons.
181
191
182
192
#### Logic Analyzers
183
193
184
194
A logic analyzer is a hardware tool designed specifically for capturing, displaying, and measuring electrical signals in a digital circuit. This tool consists of several digital inputs pins capable of detecting whether an electric signal is at a specific logic level (1 or 0). Logic analyzers are also capable of showing the relationship and timing of different electrical signals in a digital circuit and often capable also of analyzing digital communication protocols (for example, SPI communication protocol).
> "Sparkfun® images are [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/)"
198
+
> [SparkFun Electronics](https://commons.wikimedia.org/wiki/File:8-Channel_-_51738307039.jpg), [CC BY-SA 2.0](https://creativecommons.org/licenses/by-sa/2.0), via Wikimedia Commons.
189
199
190
200
#### Oscilloscopes
191
201
192
202
An oscilloscope is a hardware tool that graphically displays electrical signals and shows how those signals change over time. Signals are measured in an oscilloscope with the help of a sensor.
> [Dave Jones from Australia](https://commons.wikimedia.org/wiki/File:Rigol_DS1054Z_Oscilloscope_Teardown_PCB_(15354160277).jpg), [CC BY-SA 2.0](https://creativecommons.org/licenses/by-sa/2.0), via Wikimedia Commons.
195
207
196
208
#### Software-Defined Radios
197
209
198
210
A software-defined radio (SDR) is a radio communication system that uses software for the modulation and demodulation of radio signals. Traditional radio communications systems processing relies on hardware components; this limits their reprogramming to a very low level. SDRs are much more flexible since they can be reconfigured by software.
199
211
200
212

201
213
214
+
> [Alexander Neumann](https://commons.wikimedia.org/wiki/File:Hackrf-one-img_0004.jpg), Public domain, via Wikimedia Commons.
215
+
202
216
#### Debugging with Hardware Tools
203
217
204
218
While there may be several debugging techniques, using a LED as a pass mark for the debugging process is the simplest yet fastest method one can utilize. The indicator will be set in different points of interest to observe the correct execution of tasks visually. For instance, there can be multiple points located simultaneously to turn it on or off the LED on a single point of interest at a time for step-by-step verification. This will provide just enough information to construct an additional layer of the code or proceed to the following structure sector to debug its behavior. It will not give precise or in-depth information about registry or data exchange, so it has to be used as a tool for code structures that are not complex in their architectural nature and behave mainly in a linear trend execution. It is handy when a debugger is not available and quickly understand how the code behaves.
@@ -484,7 +498,7 @@ Debugging is an exciting topic to study; if you want to learn more about debuggi
484
498
485
499
## References
486
500
487
-
* P. Koopman, Better Embedded System Software. S.L.: Drumnadrochit Press, 2010.
488
-
* D. J. Agans, Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems. New York: Amacom, 2002.
489
-
* M. Barr and A. Massa, Programming Embedded Systems: with C and GNU Development Tools. Johanneshov: MTM, 2013.
490
-
* J. W. Valvano, Embedded Systems: Introduction to ARM® Cortex™-M Microcontrollers. United States: Self-published, 2015.
501
+
[1] P. Koopman, Better Embedded System Software. S.L.: Drumnadrochit Press, 2010.
502
+
[2] D. J. Agans, Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems. New York: Amacom, 2002.
503
+
[3] M. Barr and A. Massa, Programming Embedded Systems: with C and GNU Development Tools. Johanneshov: MTM, 2013.
504
+
[4] J. W. Valvano, Embedded Systems: Introduction to ARM® Cortex™-M Microcontrollers. United States: Self-published, 2015.
0 commit comments