Can't upload using native USB port on ESP32S2 and VS Code
Posted: Mon Apr 19, 2021 8:01 am
Hi there,
I have a ESP32S2 module on a custom PCB and I was already able to upload some code to the module. However, I was having trouble building new projects, so I reinstalled everything and now I can't upload the code to the module. I get this issue:
Executing task: d:\esp\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe d:\esp-idf\components\esptool_py\esptool\esptool.py -p COM5 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 wifi_softAP.bin <
esptool.py v3.0
Serial port COM5
Connecting...
Detecting chip type...
Traceback (most recent call last):
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3969, in <module>
_main()
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3962, in _main
main()
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3541, in main
esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace,
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 313, in detect_chip
chip_magic_value = detect_port.read_reg(ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR)
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 562, in read_reg
val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 402, in command
self._port.timeout = saved_timeout
File "D:\esp\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialutil.py", line 372, in timeout
self._reconfigure_port()
File "D:\esp\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialwin32.py", line 222, in _reconfigure_port
raise SerialException(
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command d:\esp\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe d:\esp-idf\components\esptool_py\esptool\esptool.py -p COM5 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 wifi_softAP.bin" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Also, on the device manager, the ESP32S2 appears with a yellow triangle indicating some problem with the drivers. I'm using Windows 10 64 bits with the latest updates.
I have a ESP32S2 module on a custom PCB and I was already able to upload some code to the module. However, I was having trouble building new projects, so I reinstalled everything and now I can't upload the code to the module. I get this issue:
Executing task: d:\esp\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe d:\esp-idf\components\esptool_py\esptool\esptool.py -p COM5 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 wifi_softAP.bin <
esptool.py v3.0
Serial port COM5
Connecting...
Detecting chip type...
Traceback (most recent call last):
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3969, in <module>
_main()
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3962, in _main
main()
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 3541, in main
esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace,
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 313, in detect_chip
chip_magic_value = detect_port.read_reg(ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR)
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 562, in read_reg
val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))
File "d:\esp-idf\components\esptool_py\esptool\esptool.py", line 402, in command
self._port.timeout = saved_timeout
File "D:\esp\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialutil.py", line 372, in timeout
self._reconfigure_port()
File "D:\esp\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialwin32.py", line 222, in _reconfigure_port
raise SerialException(
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command d:\esp\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe d:\esp-idf\components\esptool_py\esptool\esptool.py -p COM5 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 wifi_softAP.bin" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Also, on the device manager, the ESP32S2 appears with a yellow triangle indicating some problem with the drivers. I'm using Windows 10 64 bits with the latest updates.