Skip to content

Commit b41dc19

Browse files
committed
Corrections to Windows instructions
1 parent 21a8abb commit b41dc19

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Follow these steps:
1313

1414
1. Ensure that a serial connection must be initiated before the error occurs, by calling [Serial.begin()](https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/) in your sketch. You can include this code inside the beginning of the `setup()` function:
1515

16-
```
16+
```arduino
1717
Serial.begin(115200);
1818
while (!Serial);
1919
```
@@ -34,35 +34,34 @@ Follow these steps:
3434

3535
## Use addr2line to generate a stack trace
3636

37-
> [!NOTE]
38-
> `addr2line` is not available as a native Windows application, but can be run with <a class="link-external" href="https://learn.microsoft.com/en-us/windows/wsl/install">Windows Subsystem for Linux (WSL)</a>.
37+
The `addr2line` utility is included in the **Arduino UNO R4 Boards** boards package. However, running it in this way requires modifying the command included in the output. For convenience, you may want to install `addr2line` on your system or adding a shortcut:
38+
39+
Add `addr2line` to the command line:
40+
41+
* **Windows:** Add a shortcut to the `addr2line` executable.
3942

40-
The `addr2line` utility is included in the **Arduino UNO R4 Boards** boards package. However, running it in this way requires modifying the command included in the output. For convenience, you may want to install `addr2line` on your system.
43+
1. Open Command Prompt as Adminstrator.
44+
2. Run this command:
4145

42-
Install `addr2line` (optional):
46+
`mklink C:\Windows\System32\addr2line.exe %UserProfile%\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-addr2line.exe`
4347

44-
* **Windows (WSL):** `addr2line` is not available as a native Windows application, but can be run with <a class="link-external" href="https://learn.microsoft.com/en-us/windows/wsl/install">Windows Subsystem for Linux (WSL)</a>. The Ubuntu distribution of Linux is installed by default and should come with `addr2line`.
4548
* **macOS:** `addr2line` can be installed with [Homebrew](https://brew.sh/) by running `brew install binutils` in Terminal.
4649
* **Linux:** `addr2line` may already be installed on your system. Otherwise, run `apt-get install binutils` in Terminal (Ubuntu, Debian), or see [command-not-found.com/addr2line](https://command-not-found.com/addr2line) for other distributions.
4750

4851
### 1. Copy the addr2line command (and modify it if necessary)
4952

5053
**If addr2line is installed on your system:**
5154

52-
* **Windows (WSL):**
53-
1. Copy the command from the serial output.
54-
2. Paste the command into a text editor.
55-
3. Replace `C:` with `/mnt/c` and replace all backslashes (`\`) with forward slashes (`/`).
55+
* **Windows:** Copy the command from the serial output (no modification required).
5656
* **macOS:** Copy the command from the serial output (no modification required).
5757
* **Linux:** Copy the command from the serial output (no modification required).
5858

5959
**Using the addr2line from the board package:**
6060

61-
* **Windows (WSL):**
61+
* **Windows:**
6262
1. Copy the command from the serial output.
6363
2. Paste the command into a text editor.
64-
3. Replace the word `addr2line` with `/mnt/c/Users/User/Appdata/Local/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-addr2line`
65-
4. For the file path after the `-e` flag, replace `C:` with `/mnt/c` and replace all backslashes (`\`) with forward slashes (`/`).
64+
3. Replace the word `addr2line` with `%UserProfile%\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-addr2line.exe`
6665

6766
* **macOS:**
6867
1. Copy the command from the serial output.
@@ -78,11 +77,10 @@ Install `addr2line` (optional):
7877
> [!NOTE]
7978
> The sketch needs to have been compiled on the same computer you are running `addr2line` on.
8079
81-
* **Windows (WSL):**
82-
1. Open [Windows Powershell](https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-windows-powershell?view=powershell-7.3).
83-
2. Type `Ubuntu` into Windows Powershell and press <kbd>Enter</kbd>.
84-
3. Paste the modified command into Windows Powershell by right-clicking on the window.
85-
4. Press <kbd>Enter</kbd> to run the command.
80+
* **Windows:**
81+
1. Open Command Prompt.
82+
2. Paste the command into Command Prompt by right-clicking on the window.
83+
3. Press <kbd>Enter</kbd> to run the command.
8684
* **macOS:**
8785
1. Open Terminal.
8886
2. Press <kbd>⌘</kbd> + <kbd>V</kbd> to paste the command.

0 commit comments

Comments
 (0)