From b41dc1984dde6668b300dd0e39bcf311bc271237 Mon Sep 17 00:00:00 2001 From: seaxwi <71350948+seaxwi@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:51:30 +0200 Subject: [PATCH 1/2] Corrections to Windows instructions --- ...errors-on-UNO-R4-WiFi-using-stack-trace.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md b/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md index a74d4566..8bcb63cd 100644 --- a/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md +++ b/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md @@ -13,7 +13,7 @@ Follow these steps: 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: - ``` + ```arduino Serial.begin(115200); while (!Serial); ``` @@ -34,14 +34,17 @@ Follow these steps: ## Use addr2line to generate a stack trace -> [!NOTE] -> `addr2line` is not available as a native Windows application, but can be run with Windows Subsystem for Linux (WSL). +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: + +Add `addr2line` to the command line: + +* **Windows:** Add a shortcut to the `addr2line` executable. -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. + 1. Open Command Prompt as Adminstrator. + 2. Run this command: -Install `addr2line` (optional): + `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` -* **Windows (WSL):** `addr2line` is not available as a native Windows application, but can be run with Windows Subsystem for Linux (WSL). The Ubuntu distribution of Linux is installed by default and should come with `addr2line`. * **macOS:** `addr2line` can be installed with [Homebrew](https://brew.sh/) by running `brew install binutils` in Terminal. * **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. @@ -49,20 +52,16 @@ Install `addr2line` (optional): **If addr2line is installed on your system:** -* **Windows (WSL):** - 1. Copy the command from the serial output. - 2. Paste the command into a text editor. - 3. Replace `C:` with `/mnt/c` and replace all backslashes (`\`) with forward slashes (`/`). +* **Windows:** Copy the command from the serial output (no modification required). * **macOS:** Copy the command from the serial output (no modification required). * **Linux:** Copy the command from the serial output (no modification required). **Using the addr2line from the board package:** -* **Windows (WSL):** +* **Windows:** 1. Copy the command from the serial output. 2. Paste the command into a text editor. - 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` - 4. For the file path after the `-e` flag, replace `C:` with `/mnt/c` and replace all backslashes (`\`) with forward slashes (`/`). + 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` * **macOS:** 1. Copy the command from the serial output. @@ -78,11 +77,10 @@ Install `addr2line` (optional): > [!NOTE] > The sketch needs to have been compiled on the same computer you are running `addr2line` on. -* **Windows (WSL):** - 1. Open [Windows Powershell](https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-windows-powershell?view=powershell-7.3). - 2. Type `Ubuntu` into Windows Powershell and press Enter. - 3. Paste the modified command into Windows Powershell by right-clicking on the window. - 4. Press Enter to run the command. +* **Windows:** + 1. Open Command Prompt. + 2. Paste the command into Command Prompt by right-clicking on the window. + 3. Press Enter to run the command. * **macOS:** 1. Open Terminal. 2. Press + V to paste the command. From 9c09a276c37aa475b000f70d1f44654823eb7792 Mon Sep 17 00:00:00 2001 From: seaxwi <71350948+seaxwi@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:58:27 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Renat0Ribeir0 <86349945+Renat0Ribeir0@users.noreply.github.com> --- .../Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md b/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md index 8bcb63cd..aecea031 100644 --- a/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md +++ b/content/Hardware Support/UNO/Debug-runtime-errors-on-UNO-R4-WiFi-using-stack-trace.md @@ -34,13 +34,13 @@ Follow these steps: ## Use addr2line to generate a stack trace -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: +The `addr2line` utility is included in the **Arduino UNO R4 Boards** board 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 add a shortcut: Add `addr2line` to the command line: * **Windows:** Add a shortcut to the `addr2line` executable. - 1. Open Command Prompt as Adminstrator. + 1. Open Command Prompt as Administrator. 2. Run this command: `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`