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/hardware/02.hero/boards/uno-r4-wifi/tutorials/debugger/debugger.md
+12-11
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,22 @@
1
1
---
2
2
title: 'Debugging the Arduino UNO R4 WiFi'
3
-
description: 'Learn how to debug the UNO R4 WiFi.'
3
+
description: 'Learn how to debug the UNO R4 WiFi with the Arduino IDE.'
4
4
tags:
5
5
- Debugger
6
6
- IDE
7
7
author: 'Hannes Siebeneicher'
8
8
---
9
9
10
-
Debugging is the process of identifying and fixing errors in your code. It’s a vital skill for anyone writing code especially when dealing with microcontrollers like those on your Arduino. As with everything, debugging can be done at different levels, you can read up on the topic [here](/learn/microcontrollers/debugging).
10
+
Debugging is the process of identifying and fixing errors in your code. It’s a vital skill for anyone writing code especially when dealing with microcontrollers like those on your Arduino.
11
11
12
-
In this context, debugging is a term used to describe the process of inspecting the code at different points in time.
12
+
In this article, we will focus on using the Arduino IDE's built-in debugger, which can be used to debug the UNO R4 WiFi over USB. We will go through how to:
13
+
- Enable debugging mode in the Arduino IDE
14
+
- Create breakpoints for where we want to inspect the code
15
+
- Monitor the value of a variable at a specific point in the program
13
16
14
-
An analogy that is often used is to think of it as "stepping into" the code, grabbing full control of the clock and walking through it line by line, checking the value of variables as you go, and reading specific memory addresses to make sure information is being passed on as intended.
17
+
Note that you **do not** need an external debugger to follow this tutorial.
15
18
16
-
This is especially helpful when creating complex projects, but even as a beginner, it can be helpful to know the basics of debugging, consequently saving you time and energy when trying to find the little annoying error causing your program to break down.
17
-
18
-
This article covers the basic steps for debugging the UNO R4 WiFi using the IDE, such as setting breakpoints. A breakpoint is an intentional stopping or pausing place at a specific point in the code, allowing you to read values at that exact point. In this case, we will be using the Arduino IDE which we can use to set breakpoints, read out memory addresses, and read the value of any variable at a specific point in time.
19
+
***To learn more about general debugging principles, you can read up on the topic [here](/learn/microcontrollers/debugging).***
19
20
20
21
## Goals
21
22
@@ -32,7 +33,7 @@ The goals of this tutorial are:
32
33
33
34
## Debugging
34
35
35
-
Debugging your Arduino project allows you to dive deep into your code and troubleshoot as well as analyze the code execution. Yu can gain full access to the microcontroller's internal registers, memory, and variables. This is especially helpful when working on more complex projects where understanding the code execution flow is crucial. With the Arduino IDE you can step through the code line by line, allowing you to analyze why your code might break at a specific point.
36
+
Debugging your Arduino project allows you to dive deep into your code and troubleshoot as well as analyze the code execution. You can gain full access to the microcontroller's internal registers, memory, and variables. This is especially helpful when working on more complex projects where understanding the code execution flow is crucial. With the Arduino IDE you can step through the code line by line, allowing you to analyze why your code might break at a specific point.
36
37
37
38
## Connection
38
39
@@ -42,19 +43,19 @@ The only thing you need to do is to connect your UNO R4 WiFi to your computer us
42
43
43
44
### Setting up the Arduino IDE
44
45
45
-
First, if you haven't done it yet, install the [Arduino IDE](https://www.arduino.cc/en/software). It's a good ieda to verify that everything is working as it should by uploading the Blink example.
46
+
First, if you haven't done it yet, install the [Arduino IDE](https://www.arduino.cc/en/software). It's a good idea to verify that everything is working as it should by uploading the Blink example.
46
47
47
48

48
49
49
50
## Set Correct Programmer
50
51
51
-
To access and debug the mcu it's important that we set the correct programmer. Select **Tools** > **Programmer** > **ARM CMSIS-DAP compatible**.
52
+
To access and debug the Arduino's MCU it's important that we set the correct programmer. Select **Tools** > **Programmer** > **ARM CMSIS-DAP compatible**.
52
53
53
54

54
55
55
56
## Setting Breakpoints
56
57
57
-
As mentioned above a breakpoint is an intentional stopping or pausing place at a specific point in the code. You can add them by clicking the sidebar next to your sketch, and you should see a red dot appear. You have now set a breakpoint.
58
+
A breakpoint is an intentional stopping or pausing place at a specific point in the code. You can add them by clicking the sidebar next to your sketch, and you should see a red dot appear. You have now set a breakpoint.
58
59
59
60

0 commit comments