Skip to content

Update Arduino IDE 2.x debugger tutorials for compatibility with versions >=2.3.0 #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Let's start by opening the Arduino IDE 2 and connecting our MKR WiFi 1010 board

![The board and port recognized by the Arduino IDE 2.](assets/ide_v2_t1_img05.png)

Select **Tools > Programmer > Atmel-ICE** from the Arduino IDE menus.

### 2. Creating the Test Code

Let's try the example code show below, it is a simple program that blinks the onboard LED of our board and changes the value of variables `x` and `y` while running. Open a new sketch, copy and paste the code show below:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: This tutorial teaches you how to set up a MKR board with the Segger
This tutorial will show you how to debug an Arduino sketch using an Arduino MKR board and the Segger J-Link probe. It will go through how to connect these and use the Arduino IDE 2 to then debug a sketch.

### Required Hardware and Software
- [Arduino IDE 2](https://www.arduino.cc/en/software)
- [Arduino IDE](https://www.arduino.cc/en/software) version 2.3.0 or higher
- Segger J-link device ([EDU](https://store.arduino.cc/products/j-link-edu) or [BASE](https://store.arduino.cc/products/j-link-base-compact))
- [Arduino MKR WiFi 1010](https://store.arduino.cc/mkr-wifi-1010) (other boards from the MKR family works as well).
- Soldering equipment
Expand Down Expand Up @@ -67,17 +67,26 @@ Now we are ready to start debugging our sketch. Connect the power to the MKR boa

Then create or open the sketch that you want to debug. If you don't already have a sketch in mind, feel free to use the example sketch found at the end of this tutorial.

Select **Tools > Programmer > Segger J-Link** from the Arduino IDE menus.

Now go to the folder where the sketch is located. Add a `.json` file in the same folder as your sketch and name it `debug_custom.json`. The easiest way would be to create a text file and rename it `debug_custom.json`. In the `.json` file, add the following lines:

```arduino
{
"servertype": "jlink",
"device": "ATSAMD21G18",
"interface": "SWD",
"serverpath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL"
}
[
{
"configId": "arduino:samd:mkrwifi1010:programmer=jlink",
"server": "jlink",
"servertype": "jlink",
"device": "ATSAMD21G18",
"interface": "SWD",
"serverPath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL",
"serverpath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL"
}
]
```

If you are using a board other than the **MKR WiFi 1010**, you will need to adjust the `arduino:samd:mkrwifi1010` part of the `configId` field. Hover the mouse pointer over the board selection in the Arduino IDE toolbar in order to learn the correct identifier for the board you are using.

The `"serverpath"` field needs to be set to the path of the "J-Link GDB Server CL" tool executable file that is located under the folder of the J-Link package you installed in the previous step. The file is named:

- **If you are using Windows:** `JLinkGDBServerCL.exe`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ For this this tutorial we will be using the Arduino Zero's built-in debugger int

***Important: You should connect the Arduino Zero through its programming USB port.***

**2.** Select the board from the board/port list. When we select the Arduino Zero, the debugger icon close to the upload button will also become more visible.
**2.** Select the board from the board/port list.

**3.** Select **Tools > Programmer > Atmel EDBG**. The debugger icon close to the upload button will now become more visible.

![Debugger icon available if board is supported.](assets/icon-available.png)

Expand Down