一键导入
com-port-management
Ensure the serial COM port is available before flashing or monitoring an ESP32 device
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Ensure the serial COM port is available before flashing or monitoring an ESP32 device
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to find and maintain hardware pinout documentation for supported boards
Structured workflow for researching ESP-IDF component drivers, BSP headers, and struct compatibility before integration
Verify and manage the IDF build target (esp32, esp32s3, etc.) to avoid chip mismatch errors and wasted rebuild cycles
How to run ESP-IDF commands (idf.py) in this project
| name | COM Port Management |
| description | Ensure the serial COM port is available before flashing or monitoring an ESP32 device |
idf.py flash or idf.py monitorPermissionError(13, 'Access is denied.') or could not open port 'COMx'// turbo
[System.IO.Ports.SerialPort]::GetPortNames()
The board typically appears as COM5 (check Device Manager if unsure).
Stale Python processes from previous idf.py monitor sessions are the most common cause:
// turbo
Get-Process -Name python -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime | Format-Table -AutoSize
Kill Python processes older than a few minutes (these are leftover monitor/flash sessions):
Get-Process -Name python -ErrorAction SilentlyContinue | Where-Object { $_.StartTime -lt (Get-Date).AddMinutes(-5) } | Stop-Process -Force -PassThru | Select-Object Id, ProcessName
NOTE: Only kill processes older than 5 minutes to avoid killing active builds. Adjust the threshold as needed.
Try opening the port briefly:
// turbo
try {
$port = New-Object System.IO.Ports.SerialPort "COM5", 115200
$port.Open()
$port.Close()
Write-Host "COM5 is available"
} catch {
Write-Host "COM5 is still locked: $($_.Exception.Message)"
}
| Symptom | Cause | Fix |
|---|---|---|
PermissionError(13, 'Access is denied.') | Previous idf.py monitor still running | Kill stale Python processes |
could not open port | Port doesn't exist or device unplugged | Check USB cable, run GetPortNames() |
| Port locked after crash | esptool/monitor didn't clean up | Kill all Python processes, replug USB |