Skip to content
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

Make the readme easy to follow #1295

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
136 changes: 57 additions & 79 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/C_CPP_CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
For code navigation the [Microsoft C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) or [Clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) can be used for C/C++ language support. By default, projects created with **ESP-IDF: Create Project from Extension Template** or **ESP-IDF: Show Examples Projects** include a template for Microsoft C/C++ extension `c_cpp_properties.json` configuration file and doesn't need to be configured.

Run **ESP-IDF: Run idf.py reconfigure task** to generate the **compile_commands.json** file so language support works.

# Configuration of c_cpp_properties.json File

The [C/C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) can be used to provide C and C++ syntax highlight, code navigation and Go to declaration/definition within C and C++ files.
Expand Down
25 changes: 25 additions & 0 deletions docs/DEBUGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ Our extension implements a `ESP-IDF: Peripheral View` tree view in the `Run and

If `initCommands`, `gdbinitFile` or `initGdbCommands` are defined in launch.json, make sure to include the following commands for debug session to properly work as shown in [JTAG Debugging with command line](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/using-debugger.html#command-line).

# Setting a custom application image offset

If you modify the application image offset you need to modify openOCD launch arguments to update the application image offset. This can happens if OpenOCD output (Menu View -> Output -> `ESP-IDF`) shows an error like this:

```
Failed to get flash maps (-6)!\n❌ Error: Failed to get flash maps (-6)!\nWarn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
```

To update openOCD launch arguments, open the project's `settings.json` and add or modify:

```json
{
"idf.openOcdLaunchArgs": [
"-c",
"init",
"-c",
"reset halt",
"-c",
"esp appimage_offset 0x20000"
]
}
```

where `0x20000` is your application image offset used in the partition table.

## Using the Eclipse CDT GDB Debug Adapter

The Eclipse CDT team have published a GDB debug adapter as NPM package which we include in our extension dependencies. For more information about the debug adapter please review [CDT-GDB-Adapter Github Repository](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter).
Expand Down
9 changes: 0 additions & 9 deletions docs/HARDWARE_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Current Chips Supported in this Extension

[ESP32](https://www.espressif.com/en/products/socs/esp32)
[ESP32-C2](https://www.espressif.com/en/products/socs/esp32-c2)
[ESP32-C3](https://www.espressif.com/en/products/socs/esp32-c3)
[ESP32-C6](https://www.espressif.com/en/products/socs/esp32-c6)
[ESP32-S2](https://www.espressif.com/en/products/socs/esp32-s2)
[ESP32-S3](https://www.espressif.com/en/products/socs/esp32-s3)
[ESP32-H2](https://www.espressif.com/en/products/socs/esp32-h2)
[ESP32-P4](https://www.espressif.com/en/products/socs/esp32-p4)

The chips supported in the extension are directly dependent on the ESP-IDF and OpenOCD version you are using:

- The list of OpenOCD configuration boards is obtained from `$OPENOCD_SCRIPTS/esp-config.json` where `$OPENOCD_SCRIPTS` is your OpenOCD Scripts path.
Expand Down
25 changes: 25 additions & 0 deletions docs/tutorial/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ Several steps will be automatically done for you but explained for clarity. You
<img src="../../media/tutorials/debug/init_halted.png" alt="Initial halted" height="500">
</p>

# Setting a custom application image offset

If you modify the application image offset you need to modify openOCD launch arguments to update the application image offset. This can happens if OpenOCD output (Menu View -> Output -> `ESP-IDF`) shows an error like this:

```
Failed to get flash maps (-6)!\n❌ Error: Failed to get flash maps (-6)!\nWarn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
```

To update openOCD launch arguments, open the project's `settings.json` and add or modify:

```json
{
"idf.openOcdLaunchArgs": [
"-c",
"init",
"-c",
"reset halt",
"-c",
"esp appimage_offset 0x20000"
]
}
```

where `0x20000` is your application image offset used in the partition table.

# Navigating Through the Code, Call Stack and Threads

7. When the target is halted, the editor will show the line of code where the program halted and the list of threads in the `Call Stack` sub-window `(a)` on the `Run` icon in the Activity Bar on the side of Visual Studio Code. The first line of call stack under main `(b)` contains the last called function `app_main()`, which in turned was called from `main_task()` as shown in the previous image. Each line of the stack also contains the file name and line number `(c)` where the function was called. By clicking on each of the stack entries, you will see the file opened.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To install the nightly build follow the instructions below.
Nightly builds are available for <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension.vsix.zip">Visual Studio Code</a> or <a href="https://nightly.link/espressif/vscode-esp-idf-extension/workflows/ci/master/esp-idf-extension-open.vsix.zip">OpenVSX</a>.

- Open VS Code
- Go to Extensions
- Click menu `View` and then `Extensions`
- Click on the `...` from the top and choose `Install from VSIX...`
- Browse to the VSIX file you downloaded
- Wait for the extension to install
Expand Down
52 changes: 41 additions & 11 deletions docs_espressif/en/debugproject.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@ Table of Content (ToC)

2. :ref:`What happens in the background?`

3. :ref:`Navigating Through the Code, Call Stack and Threads`
3. :ref:`Setting a custom application image offset`

4. :ref:`Setting and Clearing Breakpoints`
4. :ref:`Navigating Through the Code, Call Stack and Threads`

5. :ref:`Halting the Target Manually`
5. :ref:`Setting and Clearing Breakpoints`

6. :ref:`Stepping Through the Code`
6. :ref:`Halting the Target Manually`

7. :ref:`Watching and Setting Program Variables`
7. :ref:`Stepping Through the Code`

8. :ref:`Setting Conditional Breakpoint`
8. :ref:`Watching and Setting Program Variables`

9. :ref:`Disassembly view`
9. :ref:`Setting Conditional Breakpoint`

10. :ref:`Watchpoints (Data Breakpoints)`
10. :ref:`Disassembly view`

11. :ref:`Send commands to GDB`
11. :ref:`Watchpoints (Data Breakpoints)`

12. :ref:`ESP-IDF: Peripheral View`
12. :ref:`Send commands to GDB`

13. :ref:`Post-mortem debug use cases`
13. :ref:`ESP-IDF: Peripheral View`

14. :ref:`Post-mortem debug use cases`


Start a debug session
Expand Down Expand Up @@ -78,6 +80,34 @@ By default it will be launched using localhost, port ``4444`` for Telnet communi

This adapter is a middle man between Visual Studio Code, configured toolchain GDB and OpenOCD server. You can see how `Espressif chips debugging works <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/index.html#how-it-works>`_ and how Visual Studio Code use `Debug adapters <https://microsoft.github.io/debug-adapter-protocol/overview>`_ to communicate with many debug tools.

Setting a custom application image offset
-------------------------------------------------------------

If you modify the application image offset you need to modify openOCD launch arguments to update the application image offset. This can happens if OpenOCD output (Menu View -> Output -> `ESP-IDF`) shows an error like this:

.. code-block::

Failed to get flash maps (-6)!
❌ Error: Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.

To update openOCD launch arguments, open the project's ``.vscode/settings.json`` and add or modify:

.. code-block:: JSON

{
"idf.openOcdLaunchArgs": [
"-c",
"init",
"-c",
"reset halt",
"-c",
"esp appimage_offset 0x20000"
]
}

where ``0x20000`` is your application image offset used in the partition table.

Navigating Through the Code, Call Stack and Threads
-------------------------------------------------------

Expand Down
Binary file added media/readme/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/commandsList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/espressifIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/flash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/flashmethod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/monitor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/openocd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/sdkconfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/serialport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/statusBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/readme/target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/youtube_tutorial_preview.png
Binary file not shown.
Loading