一键导入
esp-idf-target-management
Verify and manage the IDF build target (esp32, esp32s3, etc.) to avoid chip mismatch errors and wasted rebuild cycles
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verify and manage the IDF build target (esp32, esp32s3, etc.) to avoid chip mismatch errors and wasted rebuild cycles
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to find and maintain hardware pinout documentation for supported boards
Ensure the serial COM port is available before flashing or monitoring an ESP32 device
Structured workflow for researching ESP-IDF component drivers, BSP headers, and struct compatibility before integration
How to run ESP-IDF commands (idf.py) in this project
| name | ESP-IDF Target Management |
| description | Verify and manage the IDF build target (esp32, esp32s3, etc.) to avoid chip mismatch errors and wasted rebuild cycles |
idf.py build or idf.py flash commandidf.py fullclean (which wipes the target setting)Before building, always verify the current target:
// turbo
$cmakeCache = "build\CMakeCache.txt"
if (Test-Path $cmakeCache) {
$target = (Select-String "IDF_TARGET:INTERNAL=(.+)" $cmakeCache).Matches.Groups[1].Value
Write-Host "Current IDF target: $target"
} else {
Write-Host "WARNING: No CMakeCache.txt found - target is not set. Run set-target first."
}
Only run set-target if the target is wrong or unset. Note: set-target internally runs fullclean — it will wipe the entire build directory.
& '<profile>'; idf.py set-target esp32s3
CRITICAL:
set-targetoutput is very long. The terminal will show thefullcleanportion first, then a CMake configure. The truncated output may only showfullclean— this does NOT mean it failed. Always verify by checking CMakeCache.txt afterward.
After set-target completes, confirm the target before proceeding:
// turbo
$cmakeCache = "build\CMakeCache.txt"
if (Test-Path $cmakeCache) {
$target = (Select-String "IDF_TARGET:INTERNAL=(.+)" $cmakeCache).Matches.Groups[1].Value
if ($target -eq "esp32s3") {
Write-Host "Target confirmed: $target"
} else {
Write-Host "ERROR: Target is '$target', expected 'esp32s3'"
}
} else {
Write-Host "ERROR: CMakeCache.txt not found after set-target"
}
Only proceed with build+flash after target is confirmed:
& '<profile>'; idf.py build flash monitor
| Problem | Cause | Fix |
|---|---|---|
| "Wrong chip argument" on flash | Binary built for esp32 but device is esp32s3 | Run set-target esp32s3 then rebuild |
set-target appears to only run fullclean | Truncated terminal output — configure ran but wasn't shown | Check build/CMakeCache.txt for IDF_TARGET |
Target resets to esp32 after fullclean | fullclean removes the target setting file | Always run set-target after fullclean |
| COM port locked during flash | Previous idf.py monitor still holding the port | Kill the previous terminal/process first |
This project targets esp32s3 (Waveshare ESP32-S3-Touch-AMOLED-1.8).