VS Code ESP-IDF Extension: ESP-IDF: Set target creates build artifacts in project root instead of build/
Posted: 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`?
--- Thanks in advance!
## 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`?
--- Thanks in advance!