Skip to content

Conversation

@radurentea
Copy link
Collaborator

@radurentea radurentea commented May 19, 2025

Description

WARNING: This PR should not be merged until a new release from OpenOCD (current version is v0.12.0-esp32-20250422)

With this new feature, when we set the device target, we will now run a script which will detect all the connected boards. In the background this will run OpenOCD, which will make showing the possible device target list a bit slower.

There are 2 validations happening:

  1. We check that the script <idf_tools_path>/tools/openocd-esp32/<version>/openocd-esp32/share/openocd/espressif/tools/esp_detect_config.py exists
  2. There are no debugging active sessions. (Script doesn't work correctly if debugging session is active)

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Have an ESP device target connected to the PC.
  2. Change the script in idf_tools_path>/tools/openocd-esp32/<version>/openocd-esp32/share/openocd/espressif/tools/esp_detect_config.py with the one from openocd's master branch
  3. In an opened project, press the status bar icon to set the device target
  4. Connected devices should appear in the list at the top, having their own separated section. They can also be identified by their "Status: CONNECTED" text.
  5. You should be able to build, flash, monitor and debug the selected device without any problems.

Another scenario to test is: if the OpenOCD version is correct but the Python script fails (e.g., not found), the device target list needs to falls back to the previous implementation.

How has this been tested?

As described above.

Test Configuration:

  • ESP-IDF Version: 5.5
  • OS (Windows,Linux and macOS): MacOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@radurentea radurentea requested a review from brianignacio5 May 19, 2025 13:13
@radurentea radurentea self-assigned this May 19, 2025
@github-actions
Copy link

github-actions bot commented May 19, 2025

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@github-actions
Copy link

github-actions bot commented Jun 5, 2025

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Jun 5, 2025
@radurentea radurentea removed the stale Stale PR or Issue label Jun 5, 2025
Adds a check to verify that esp_detect_config.py exists before attempting to run it.
This prevents potential errors when the script is missing and provides clearer error
messages to users
@radurentea radurentea force-pushed the feature/add-devkits-support branch from 6d03233 to aa3712c Compare June 18, 2025 07:21
@radurentea radurentea requested a review from Fabricio-ESP June 20, 2025 07:04
@radurentea radurentea force-pushed the feature/add-devkits-support branch from 4c79009 to 6746806 Compare June 20, 2025 07:11
@radurentea radurentea added this to the v1.11.0 milestone Jun 20, 2025
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

An small thing, in setTargetInIDF.ts we should add a line before spawn (line 78) to print something in OutputChannel (OutputChannel.appendLine("Running IDF Set Target action", "Set Target"); for example) to add a separation between set-target output.

Right now the Detect OpenOCD Config tag is closing after set target output (because spawn also print in OutputChannel).

- Validation is hard to maintain and unnecessary if we validate based on existing "esp_detect_config.py" script
@radurentea radurentea requested a review from brianignacio5 June 26, 2025 07:09
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed successfully detecting connected devkits, and able to distinguish between multiple boards to run flash and debug over jtag.
Testes on windows11, MacOS15 and Ubuntu24

@radurentea radurentea merged commit 7590504 into master Jul 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants