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

use IDF_TARGET in customExtraVars if no sdkconfig #1385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brianignacio5
Copy link
Collaborator

@brianignacio5 brianignacio5 commented Dec 26, 2024

Description

To find the current IDF_TARGET the extension reads the sdkconfig in v1.9.0 but before there was a idf.adapterTargetName configuration setting which was used to resolve IDF_TARGET. The previous logic would fail if the current project is configure for a target (say esp32) but the configuration setting is set to (say esp32c3).

Reading from sdkconfig seems like a better approach, but what happens when you want to define a IDF_TARGET but no sdkconfig exists ? For this case we still need to persist this somehow. Now we would use idf.customExtraVars configuration setting and add IDF_TARGET when running the ESP-IDF: Set Espressif Device Target command. The extension will use this value when sdkconfig IDF_TARGET value doesn't exist.

Fixes #1363

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Steps to test this pull request

  1. Run the ESP-IDF: Set Espressif Device Target on a ESP-IDF project. This will create an sdkconfig file and build project.
  2. Delete the build directory and sdkconfig file.
  3. Run the ESP-IDF: Build your project command. The project should build with the target defined before instead of previously default esp32.
  • Expected behaviour:

The IDF_TARGET that was set in 1 is still used when sdkconfig has been deleted for other extension commands like ESP-IDF: Build your project.

  • Expected output:

The IDF_TARGET that was set in 1 is still used when sdkconfig has been deleted for other extension commands like ESP-IDF: Build your project.

How has this been tested?

Manual test by following steps above.

Test Configuration:

  • ESP-IDF Version: 5.3.1
  • 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

@brianignacio5 brianignacio5 added this to the v1.9.1 milestone Dec 26, 2024
@brianignacio5 brianignacio5 self-assigned this Dec 26, 2024
Copy link

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.

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.

Can't switch target on v1.9.0 (VSC-1537)
1 participant