VS Code ESP-IDF Extension: ESP-IDF: Set target creates build artifacts in project root instead of build/

TenSprite
Posts: 1
Joined: Wed Sep 17, 2025 1:28 am

VS Code ESP-IDF Extension: ESP-IDF: Set target creates build artifacts in project root instead of build/

Postby TenSprite » Wed Sep 17, 2025 2:05 am

# VS Code ESP-IDF Extension `set-target` generates sdkconfig in project root instead of build folder → causes `project_description.json` error

## Environment
- OS: Windows 10 x64
- ESP-IDF Extension: 1.10.3
- ESP-IDF: v5.5.1
- Board: ESP32-S3 (USB-JTAG)

---

## Problem Summary
- After running **`ESP-IDF: Set target` (esp32s3)** in VS Code, the process fails with an error.
- At this point, if I try to run `menuconfig`, it also fails because `build/project_description.json` is missing.
- If I run **Build** once, then `menuconfig` works fine again.
- This suggests that the `set-target` outputs are not being written into the `build/` folder as expected.

Failed to set target esp32s3: non zero exit code 2
...
Set Target to: esp32s3, new sdkconfig will be created.
Running cmake in directory .../Bluedroid_Beacon/build
...
-- Project sdkconfig file C:/Users/Lighten/Desktop/esp_example/Bluedroid_Beacon/sdkconfig
...
Cannot load ...\Bluedroid_Beacon\build/project_description.json: [Errno 2] No such file or directory

## Sequence to Reproduce
1. Open a new project (e.g., `Bluedroid_Beacon`) in VS Code
2. Run Command Palette → `ESP-IDF: Set target` → select `esp32s3`
- `bootloader/`, `bootloader-prefix`, `project_description.json` are incorrectly created in the **project root**
- `menuconfig` fails because `build/project_description.json` does not exist
3. Run `ESP-IDF: Menuconfig` → **fails**
4. Run **Build project** → the missing artifacts are now generated properly inside `build/`
5. Run `ESP-IDF: Menuconfig` again → **works fine**

## Expected Behavior
- All generated build artifacts (`bootloader/`, `bootloader-prefix`, `project_description.json`, etc.) should be created inside the `build/` folder when running `ESP-IDF: Set target`.
- `menuconfig` should work immediately after `ESP-IDF: Set target`, without requiring an extra build.

---
## Questions
1. Is this the intended behavior of the VS Code ESP-IDF extension, or a bug?
2. Why are `bootloader/`, `bootloader-prefix`, and `project_description.json` created in the project root instead of the `build/` folder?
3. Is there a recommended way to reset/clean the project so that `set-target` always generates these files in `build/`?
4. Should the expected workflow always be: **Set target → Build → Menuconfig**, or should `menuconfig` work right after `set-target`?

---
스크린샷 2025-09-17 105246.png
스크린샷 2025-09-17 105246.png (44.55 KiB) Viewed 1571 times
Thanks in advance!

radurentea
Espressif staff
Espressif staff
Posts: 26
Joined: Thu Mar 09, 2023 8:30 am

Re: VS Code ESP-IDF Extension: ESP-IDF: Set target creates build artifacts in project root instead of build/

Postby radurentea » Tue Sep 30, 2025 9:53 am

Hi and sorry for the late response,

I encourage you in the future, if you encounter any issues with the extension, to open an issue on the github repo https://github.com/espressif/vscode-esp ... ion/issues. We have a better visibility there.

1 & 2) This is not the intended behavior. The default location when using "set target command" would be "${workspace}\\build". Is there a possibility that you've changed the "idf.buildPathWin" property in settings.json inside .vscode folder of your project or in your user settings of vs code ("Preferences: Open User Settings (JSON)")?
I've tried reproducing the issue locally but I couldn't.

3) You can manually add "idf.buildPathWin" in your .vscode/settings.json, this will set the build folder at project level. Or you can use command "Preferences: Open User Settings (JSON)" and add "idf.buildPathWin": "${workspaceFolder}\\build"

4) If you want to modify something in menuconfig you should do it before build, or if you choose to do modifications in menuconfig after build, you will have to rebuild the project.

Let me know if you still encounter issues

Who is online

Users browsing this forum: Applebot, Bing [Bot] and 17 guests