-
Notifications
You must be signed in to change notification settings - Fork 121
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
Docs migration #1076
Docs migration #1076
Changes from 17 commits
5c88348
3a622cd
891c117
194661f
4acd222
d4ec1e6
33f0805
bc2c72a
3bd4692
e00ee9e
625f177
697dfc5
4413040
31bc349
2b13a9c
1539e0c
af86d40
4316a0f
539bc13
f56fbf6
7a9b6dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,62 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: Comment on pull request | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
workflow_run: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
workflows: [CI] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
types: [completed] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pr_comment: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- uses: actions/github-script@v7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# This snippet is public-domain, taken from | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
script: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
async function upsertComment(owner, repo, issue_number, purpose, body) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const {data: comments} = await github.rest.issues.listComments( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{owner, repo, issue_number}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const marker = `<!-- bot: ${purpose} -->`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
body = marker + "\n" + body; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const existing = comments.filter((c) => c.body.includes(marker)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (existing.length > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const last = existing[existing.length - 1]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
core.info(`Updating comment ${last.id}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await github.rest.issues.updateComment({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
owner, repo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
body, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
comment_id: last.id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
core.info(`Creating a comment in issue / PR #${issue_number}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await github.rest.issues.createComment({issue_number, body, owner, repo}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const {owner, repo} = context.repo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const run_id = ${{github.event.workflow_run.id}}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!pull_requests.length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return core.error("This workflow doesn't match any pull requests!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const artifacts = await github.paginate( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!artifacts.length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return core.error(`No artifacts found`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let body = `Download the artifacts for this pull request:\n`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (const art of artifacts) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
core.info("Review thread message body:", body); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (const pr of pull_requests) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
body += `\n [Espressif-IDE Documentation Preview](https://preview-docs.espressif.com/projects/espressif-ide/en/${pr.number}-merge/index.html)`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await upsertComment(owner, repo, pr.number, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"nightly-link", body); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+38
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Several improvements needed in the main script logic.
Apply these improvements: const artifacts = await github.paginate(
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
if (!artifacts.length) {
return core.error(`No artifacts found`);
}
let body = `Download the artifacts for this pull request:\n`;
for (const art of artifacts) {
- body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
+ const artifactUrl = encodeURI(`https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip`);
+ body += `\n* [${art.name}.zip](${artifactUrl})`;
}
core.info("Review thread message body:", body);
for (const pr of pull_requests) {
- body += `\n [Espressif-IDE Documentation Preview](https://preview-docs.espressif.com/projects/espressif-ide/en/${pr.number}-merge/index.html)`;
+ const docsBaseUrl = process.env.DOCS_PREVIEW_URL || 'https://preview-docs.espressif.com';
+ const docsUrl = `${docsBaseUrl}/projects/espressif-ide/en/${pr.number}-merge/index.html`;
+ body += `\n [Espressif-IDE Documentation Preview](${docsUrl})`;
await upsertComment(owner, repo, pr.number,
"nightly-link", body);
-}
+}
+ 📝 Committable suggestion
Suggested change
🧰 Tools🪛 yamllint[error] 62-62: no new line character at the end of file (new-line-at-end-of-file) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,47 @@ | ||||||
Application Level Tracing | ||||||
========================= | ||||||
|
||||||
ESP-IDF provides a useful feature for program behavior analysis called `Application Level Tracing <https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-guides/app_trace.html?>`_. The IDF-Eclipse plugin has a UI that allows you to start and stop tracing commands and process the received data. To familiarize yourself with this library, you can use the `app_trace_to_host <https://github.com/espressif/esp-idf/tree/release/v5.0/examples/system/app_trace_to_host>`_ project or the `app_trace_basic <https://github.com/espressif/esp-idf/tree/release/v5.1/examples/system/app_trace_basic>`_ project (if using esp-idf 5.1 and higher). These projects can be created from the plugin itself: | ||||||
|
||||||
.. image:: ../../../media/AppLvlTracing_1.png | ||||||
:alt: Application Level Tracing project creation | ||||||
|
||||||
Before using application-level tracing, create a debug configuration for the project where you must select the board you are using to successfully start the OpenOCD server. | ||||||
|
||||||
.. image:: ../../../media/AppLvlTracing_3.png | ||||||
:alt: Debug configuration setup | ||||||
|
||||||
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance debug configuration instructions. The debug configuration setup section could benefit from more detailed step-by-step instructions, including:
|
||||||
After creating the debug configuration, right-click on the project in the Project Explorer and select *ESP-IDF > Application Level Tracing*: | ||||||
|
||||||
.. image:: ../../../media/AppLvlTracing_2.png | ||||||
:alt: Application Level Tracing option in the context menu | ||||||
|
||||||
It may take a moment to open the application level tracing dialog, as the OpenOCD server starts first. At the top of the dialog, you will find auto-configured fields that you can adjust for the trace start command. | ||||||
|
||||||
**Start Command:** | ||||||
|
||||||
- Syntax: ``start <outfile> [poll_period [trace_size [stop_tmo [wait4halt [skip_size]]]]`` | ||||||
- Arguments: | ||||||
- ``outfile``: Path to the file where data from both CPUs will be saved, with format ``file://path/to/file``. | ||||||
- ``poll_period``: Data polling period (in ms). If greater than 0, the command runs in non-blocking mode. Default: 1 ms. | ||||||
- ``trace_size``: Maximum data size to collect (in bytes). Tracing stops after the specified amount of data is received. Default: -1 (disabled). | ||||||
- ``stop_tmo``: Idle timeout (in sec). Stops tracing if there is no data for the specified period. Default: -1 (disabled). | ||||||
- ``wait4halt``: If 0, tracing starts immediately; otherwise, waits for the target to halt before starting. Default: 0. | ||||||
- ``skip_size``: Bytes to skip at the start. Default: 0. | ||||||
|
||||||
Additional information can be found `here <https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-guides/app_trace.html?>`_. | ||||||
|
||||||
.. image:: ../../../media/AppLvlTracing_4.png | ||||||
:alt: Application Level Tracing dialog | ||||||
|
||||||
The next two fields, *Trace Processing Script* and *Start Parsing Command*, are used to parse the output file. | ||||||
|
||||||
- **Trace Processing Script**: Path to the parsing script, which by default is ``logtrace_proc.py`` from esp-idf. | ||||||
- **Start Parsing Command**: Allows you to check and edit the parsing command if necessary. By default, it is configured as: ``$IDF_PATH/tools/esp_app_trace/logtrace_proc.py/path/to/trace/file/path/to/program/elf/file``. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Clarify the parsing command format. The current format of the Start Parsing Command is ambiguous:
Consider reformatting it for better clarity: -$IDF_PATH/tools/esp_app_trace/logtrace_proc.py/path/to/trace/file/path/to/program/elf/file
+$IDF_PATH/tools/esp_app_trace/logtrace_proc.py <trace_file_path> <program_elf_path> 📝 Committable suggestion
Suggested change
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 🛠️ Refactor suggestion Add explicit instructions for setting up
🔗 Analysis chainVerify and document IDF_PATH requirement. The documentation uses Consider adding a note about IDF_PATH setup requirements or linking to the relevant setup documentation. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if IDF_PATH setup is documented elsewhere
rg -l "IDF_PATH" docs/
Length of output: 113 Script: #!/bin/bash
# Extract lines containing IDF_PATH from the relevant documentation files
rg "IDF_PATH" docs/en/additionalfeatures/appleveltracing.rst docs/en/additionalfeatures/esp-terminal.rst
Length of output: 681 |
||||||
|
||||||
The *Start parse* button is disabled until a dump file is generated. To generate it, click the *Start* button at the bottom of the dialog box. This button changes to *Stop* once tracing starts, allowing you to stop it. | ||||||
|
||||||
When the output file is available, click *Start parse* to view the parsed script output in the Eclipse console: | ||||||
|
||||||
.. image:: ../../../media/AppLvlTracing_5.png | ||||||
:alt: Parsed script output in Eclipse console |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
ESP-IDF Application Size Analysis | ||
=================================== | ||
|
||
The Application Size Analysis editor provides a way to analyze the static memory footprint of your application. It has two sections: | ||
|
||
- The **Overview** section provides a summary of the application's memory usage; | ||
- The **Details** section includes in-depth details about components and per-symbol level memory information. | ||
|
||
The **Details** table viewer also provides searching and sorting capabilities on various columns. | ||
|
||
To launch the Application Size Analysis editor: | ||
|
||
#. Right-click on the project. | ||
#. Select **ESP-IDF > Application Size Analysis** menu option to launch the editor. | ||
|
||
**Application Size Analysis - Overview** | ||
|
||
.. image:: ../../../media/sizeanalysis_overview.png | ||
:alt: Application Size Analysis - Overview | ||
|
||
**Application Size Analysis - Details** | ||
|
||
.. image:: ../../../media/sizeanalysis_details.png | ||
:alt: Application Size Analysis - Details |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,58 @@ | ||||||||||||||
.. _clangd_cdt_support: | ||||||||||||||
|
||||||||||||||
Espressif-IDE LSP Support for C/C++ Editor | ||||||||||||||
========================================== | ||||||||||||||
|
||||||||||||||
The Espressif-IDE 3.0.0 (and higher) now includes the `Eclipse CDT-LSP <https://github.com/eclipse-cdt/cdt-lsp/>`, enabling support for the latest C/C++ standards and providing an LSP-based C/C++ Editor. This editor, powered by the `LLVM <https://clangd.llvm.org/>` clangd C/C++ language server, offers advanced functionality for ESP-IDF developers. | ||||||||||||||
|
||||||||||||||
In line with this enhancement, we've discontinued support for the standard CDT Editor/Indexer, as it only offers support for up to C++ 14. This has been replaced with a new LSP editor, especially considering that ESP-IDF now utilizes C++ 20 (with GCC 11.2) in v5.0.x, transitions to C++ 23 (with GCC 12.1) in v5.1, and to C++ 23 with GCC 13.1 in v5.2. | ||||||||||||||
|
||||||||||||||
The LSP powered C/C++ editor greatly benefits ESP-IDF developers by aligning with the latest language standards and compiler versions, enhancing productivity, and improving code quality. | ||||||||||||||
|
||||||||||||||
You can find more details on the LSP based C/C++ Editor features `here <https://github.com/eclipse-cdt/cdt-lsp/>`_. | ||||||||||||||
|
||||||||||||||
Prerequisites | ||||||||||||||
------------- | ||||||||||||||
* You need to have Espressif-IDE 3.0.0 (and higher) to have access to the LSP powered C/C++ editor. | ||||||||||||||
* If you are updating Eclipse CDT or Espressif-IDE via the update site, you need to select the ESP-IDF Eclipse Plugin and its dependencies, as shown below: | ||||||||||||||
|
||||||||||||||
.. image:: ../../../media/clangd/cdtlsp_updatesite.png | ||||||||||||||
|
||||||||||||||
Clangd Configuration | ||||||||||||||
-------------------- | ||||||||||||||
|
||||||||||||||
By default, the esp-clang toolchain is installed as a part of the ESP-IDF tools installation process, and clangd **Path** is configured in the preferences. | ||||||||||||||
|
||||||||||||||
The **Drivers** path and **--compile-commands-dir** path will be configured based on the selected target (esp32, esp32c6 etc.) and the project you're building. | ||||||||||||||
|
||||||||||||||
However, if there are any issues in configuration, this can be configured in the following way: | ||||||||||||||
|
||||||||||||||
1. Go to `Window` > `Preferences` > `C/C++` > `Editor(LSP)` | ||||||||||||||
2. Navigate to `clangd` node | ||||||||||||||
3. Provide `Drivers` path as shown in the screenshot. | ||||||||||||||
4. Set `--compile-commands-dir=/project/build` in the additional argument section. | ||||||||||||||
5. Click on `Apply and Close`. | ||||||||||||||
|
||||||||||||||
.. image:: ../../../media/clangd/clangd_config.png | ||||||||||||||
|
||||||||||||||
By default, when you create a new project, a `.clangd` configuration file is created with the following arguments. | ||||||||||||||
|
||||||||||||||
However, if you are dealing with an existing project, please create a `.clangd` file at the root of the project and add the following content. | ||||||||||||||
|
||||||||||||||
.. code-block:: yaml | ||||||||||||||
|
||||||||||||||
CompileFlags: | ||||||||||||||
CompilationDatabase: build | ||||||||||||||
Remove: [-m*, -f*] | ||||||||||||||
Comment on lines
+44
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Document .clangd configuration options The .clangd configuration file options need explanation for users to understand their purpose. Add explanatory comments: CompileFlags:
CompilationDatabase: build # Directory containing compile_commands.json
Remove: [-m*, -f*] # Remove machine-specific and format-specific compiler flags 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
Disable CDT Indexer | ||||||||||||||
------------------- | ||||||||||||||
|
||||||||||||||
With Espressif-IDE 3.0.0 (and higher), the CDT Indexer is disabled by default; instead, the LSP Indexer server will be used for code analysis. | ||||||||||||||
|
||||||||||||||
If, for some reason, it is not disabled, please follow the steps below to disable it. | ||||||||||||||
|
||||||||||||||
1. Go to `Window` > `Preferences` > `C/C++` > `Indexer` | ||||||||||||||
2. Uncheck `Enable Indexer` option and then click on `Apply and Close`. | ||||||||||||||
|
||||||||||||||
.. image:: ../../../media/clangd/cdt_indexer_disable.png |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Configuring Clang Toolchain | ||
=========================== | ||
|
||
1. After creating a new project, edit the project configuration. | ||
|
||
.. image:: https://user-images.githubusercontent.com/24419842/194882285-9faadb5d-0fe2-4012-bb6e-bc23dedbdbd2.png | ||
:alt: Project Configuration | ||
|
||
2. Go to the ``Build Settings`` tab and select the clang toolchain: | ||
|
||
.. image:: https://user-images.githubusercontent.com/24419842/194882462-3c0fd660-b223-4caf-964d-58224d91b518.png | ||
:alt: Clang Toolchain Selection | ||
|
||
.. note:: | ||
Clang toolchain is currently an experimental feature, and you may encounter build issues due to incompatibility with ESP-IDF. The following describes how to address the most common build issues on the current ESP-IDF master (ESP-IDF v5.1-dev-992-gaf28c1fa21-dirty). To work around clang build errors, please refer to `this workaround guide <https://github.com/espressif/idf-eclipse-plugin/blob/master/WORKAROUNDS.md#clang-toolchain-buid-errors>`_. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CMake Editor | ||
============ | ||
|
||
The CMake Editor Plug-in is integrated with the IDF Plugin for editing CMake files, such as ``CMakeLists.txt``. It provides syntax coloring, CMake command content assistance, and code templates. | ||
|
||
.. image:: ../../../media/cmake_editor_ca.png | ||
:alt: CMake Editor with content assist | ||
|
||
CMake editor preferences can be controlled using **Eclipse > Preferences > CMakeEd**. | ||
|
||
.. image:: ../../../media/cmake_editor_preferences.png | ||
:alt: CMake editor preferences |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Configuring Environment Variables | ||
================================== | ||
|
||
All the required environment variables are automatically configured by the IDE during the ESP-IDF and Tools installation process (``Espressif > ESP-IDF Manager > Add ESP-IDF``). You can verify these variables in the Preferences page under ``C/C++ > Build > Environment``. | ||
|
||
.. image:: ../../../media/2_environment_pref.png | ||
:alt: Environment Preferences |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.. _coredumpdebugging: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Core Dump Debugging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
==================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The IDF-Eclipse plugin allows you to debug the core dump if any crash occurs on the chip and the configurations are set. Currently, only the UART core dump capture and debugging is supported. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance the introduction with more context. The introduction should provide more context about core dumps and prerequisites. -The IDF-Eclipse plugin allows you to debug the core dump if any crash occurs on the chip and the configurations are set. Currently, only the UART core dump capture and debugging is supported.
+A core dump is a snapshot of the CPU registers and memory at the time of a crash, which can be invaluable for post-mortem debugging. The IDF-Eclipse plugin provides integrated support for analyzing core dumps captured when your ESP device crashes. Currently, only UART-based core dump capture and debugging is supported.
+
+Prerequisites:
+* ESP-IDF v4.x or later
+* Serial connection to your ESP device
+* Sufficient storage space for core dump files 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To enable core dump debugging for a project: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1. You need to enable it first in `sdkconfig`. Launch the `sdkconfig` in the project root by double-clicking on it which will open the configuration editor. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2. Click on the `Core Dump` from the settings on the left and select `Data Destination` as `UART`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+8
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Provide more detailed configuration instructions. The configuration steps should be more comprehensive and include all necessary menuconfig options. To enable core dump debugging for a project:
-1. You need to enable it first in `sdkconfig`. Launch the `sdkconfig` in the project root by double-clicking on it which will open the configuration editor.
+1. Open the project configuration:
+ * Right-click on your project in Project Explorer
+ * Select "ESP-IDF: Launch SDK Configuration Editor"
+ * Alternatively, double-click `sdkconfig` in your project root
-2. Click on the `Core Dump` from the settings on the left and select `Data Destination` as `UART`.
+2. Configure core dump settings:
+ * Navigate to "Component config → Core dump"
+ * Enable "Core dump on crash"
+ * Set "Data destination" to "UART"
+ * Configure other options as needed:
+ * "Logging level" (recommended: Info)
+ * "Core dump data compression" (optional)
+
+3. Save the configuration and exit the editor 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.. image:: ../../../media/CoreDumpDebugging/sdkconfig_editor.png | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This will enable the core dump debugging, and whenever you connect a serial monitor for that project, if any crash occurs, it will load the dump and open a debug perspective in Eclipse to let you diagnose the dump where you can view all the information in the core dump. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can view the registers stack trace and even view the value of variables in the stack frame. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To exit the debug session: simply press the `stop` button. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+16
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Expand usage instructions and add troubleshooting section. The usage section should include more detailed information about interpreting debug data and common troubleshooting scenarios. This will enable the core dump debugging, and whenever you connect a serial monitor for that project, if any crash occurs, it will load the dump and open a debug perspective in Eclipse to let you diagnose the dump where you can view all the information in the core dump.
-You can view the registers stack trace and even view the value of variables in the stack frame.
+Debug Information Available:
+* Register values at the time of crash
+* Stack trace showing the call hierarchy
+* Variable values in each stack frame
+* Memory contents around the crash location
+
+Interpreting Debug Information:
+1. The stack trace shows the sequence of function calls leading to the crash
+2. Register values can indicate the CPU state at crash time
+3. Variable values help understand the program state
+
+Common Troubleshooting Scenarios:
+* If the core dump fails to load, verify your serial connection
+* If variable values are optimized out, rebuild with debug symbols
+* For memory corruption crashes, examine nearby memory contents
To exit the debug session: simply press the `stop` button.
+
+.. note::
+ For more examples and troubleshooting tips, refer to the ESP-IDF Programming Guide's Core Dump section. 📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. _dfuflashing: | ||
|
||
Device Firmware Upgrade (DFU) through USB | ||
========================================== | ||
|
||
Device Firmware Upgrade (DFU) is a mechanism for upgrading the firmware of devices through Universal Serial Bus (USB). There are a few requirements that need to be met: | ||
|
||
- DFU is supported by ESP32-S2 and ESP32-S3 chips. | ||
- You will need to do some electrical connection work. Here is a `guide <https://blog.espressif.com/dfu-using-the-native-usb-on-esp32-s2-for-flashing-the-firmware-b2c4af3335f1>`_ for the ESP32-S2 board. The necessary connections for the USB peripheral are shown in the following table. | ||
|
||
+------+---------------+ | ||
| GPIO | USB | | ||
+======+===============+ | ||
| 20 | D+ (green) | | ||
+------+---------------+ | ||
| 19 | D- (white) | | ||
+------+---------------+ | ||
| GND | GND (black) | | ||
+------+---------------+ | ||
| +5V | +5V (red) | | ||
+------+---------------+ | ||
|
||
After meeting the above requirements: | ||
|
||
1. The chip needs to be in bootloader mode for detection as a DFU device and flashing. This can be achieved by pulling GPIO0 down (e.g., pressing the BOOT button), pulsing RESET down for a moment, and releasing GPIO0. | ||
2. Install USB drivers (Windows only). The drivers can be installed by the `Zadig tool <https://zadig.akeo.ie/>`_. | ||
- Ensure that the device is in download mode before running the tool and that it detects the device before installing the drivers. | ||
- The Zadig tool might detect several USB interfaces of the target. Install the WinUSB driver only for the interface without a driver installed (likely Interface 2), and avoid re-installing drivers for other interfaces. | ||
- Manual driver installation via Device Manager in Windows is not recommended, as it might cause flashing issues. | ||
|
||
After meeting the above requirements, you can proceed to build and flash via DFU. To use DFU: | ||
|
||
1. Edit the active launch configuration. | ||
2. In the main tab, select the *Flash over DFU* option. | ||
3. Select a suitable IDF target for DFU. | ||
4. When using the build command, an extra file (``dfu.bin``) will be created, which can be used later for flashing. | ||
|
||
.. image:: https://user-images.githubusercontent.com/24419842/226182180-286099d3-9c1c-4394-abb0-212d43054529.png | ||
:alt: DFU actions | ||
|
||
Additional information, including common errors and known issues, is available in `this <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/dfu.html#usb-drivers-windows-only>`_. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
ESP-IDF Terminal | ||
=============================== | ||
|
||
This would launch a local terminal with all the environment variables set under ``Preferences`` > ``C/C++`` > ``Build`` > ``Environment``. The default working directory would be either the currently selected project or ``IDF_PATH`` if there is no project selected. | ||
|
||
The terminal ``PATH`` is also configured with ``esptool``, ``espcoredump``, ``partition_table``, and ``app_update`` component paths, so it is convenient to access them directly from the ESP-IDF terminal. | ||
|
||
To launch the ESP-IDF Terminal: | ||
|
||
- Click on the ``Open a Terminal`` icon from the toolbar. | ||
- Choose ``ESP-IDF Terminal`` from the terminal drop-down and click ``OK`` to launch a terminal. | ||
|
||
.. image:: ../../../media/idf_terminal.png | ||
:alt: ESP-IDF Terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling to the comment management function.
The
upsertComment
function should include try-catch blocks to handle potential API failures gracefully.📝 Committable suggestion