I
just downloaded VSCode and I keep getting this error when I try to
upload code to the ESP32.:Failed to launch GDB: .pioinit:11: Error in
sourced command file: Remote communication error. Target disconnected.
Latest versions of VSCode & PlatformIO.
DOIT ESP32 DEVKIT
Any fixes for this?
Hi.
Do you have another ESP32 to experiment with? Just to make sure it is not an hardware problem.
Regards,
Sara
I have tried 4 units and the result is the same. The debug console displays:
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Error: unable to find a matching CMSIS-DAP device
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.
I’m new to this, so I’m not sure where to look for a fix or assistance. I’ve uninstalled everything and then reinstalled,
but the result is the same.
Hi.
Which instructions did you follow to install VS Code?
Which code are you trying to upload?
How are you connecting your board to your computer?
Can you show me some printscreen about your issue?
To share a printscreen upload a picture to google drive, dropbox, or imgur, and then share a link to the image.
Regards,
Sara
Hi Sara,
ERROR: https://drive.google.com/drive/u/2/my-drive
INSTRUCTIONS: https://randomnerdtutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/
CODE: BLINK example from the instructions followed above.
CONNECTION: Computer USB Port and no Debugger Board.
PLATFORMIO.INI FILE:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
Thank you for trying to help me with this problem.
Joel
Hi.
Please update your links to the drive. Those are not the correct links:
- Right click on the selected image in Google Drive
2. Select “Get link”
3. Copy link.
How are you connecting your board to the computer?
Which board do you have? Try selecting a different board when you create the project.
Regards,
Sara
ERROR: https://drive.google.com/file/d/1ZLBGMseRUZlcEF805kHsmpXwkoiywBZB/view?usp=share_link
JSON FILE: https://drive.google.com/file/d/1fcHHXv60vpmx1Zi2HqGhpEjtCknJMMss/view?usp=share_link
CONNECTION: Computer USB Port and no Debugger Board.
esp32doit-devkit-v1
I will try selecting a different board with a new project.
Thank you,
Joel
Hi Sara,
I uninstalled PlatformIO, VSCode, and deleted all project folders. I re-installed everything and verified the GDB version that is installed: https://drive.google.com/file/d/16B7rwMJjeqhqgMw1dtJ27L7xBbKm3VOj/view?usp=share_link
I tried the BLINK code again using a new WRoom board, and got the same result, except if I understand the new debug console error correctly, it can’t find the GDB debugger.
Debug Console: https://drive.google.com/file/d/1fcHHXv60vpmx1Zi2HqGhpEjtCknJMMss/view?usp=share_link
I installed the GDB following the instructions at this site: https://code.visualstudio.com/docs/cpp/config-mingw
With those instructions, the GDB was installed in this folder: C:\msys64\mingw64\bin
Has anyone else posted this problem? I’ve tried searching the web for this error, but the results are minimal and in most cases, don’t apply.
Hi.
I also couldn’t find any information about that issue.
At what stage exactly do you get that error?
Regards,
Sara
The debugger error occurs after the GDB debugger is executed. I located the GDB file and ran it without VSCode.
This error: “warning: Couldn’t determine a path for the index cache directory.”
comes from the GDB when it executes.
This problem is occurring on my desktop computer in Windows 11. I selected Ubuntu on the boot manager and attempted to download the program again, but this time the bootloader would not download the code.
I went to my laptop using Win 11 and tried VSCode on it, and surprise, I got the same errors with a different dev board on it as well. The laptop has Ubuntu on it also, so I tried the same experiment, and it responded the same as the desktop Ubuntu.
Is there any chance that you have a new computer you could install VSCode for the first time and see if perhaps you can duplicate the error? Maybe there is a VSCode or PlatformIO bug?
Installing the debugger was suggested in a thread when I was looking for a solution. I downloaded the Arduino IDE and was able to upload the blink code to the ESP32 Dev board. It successfully ran, but for some reason, VSCode just can’t make the connection. I also installed the CP210x driver just in case mine was corrupt, but it made no difference.
Hi Sara,
What WIN 11 USB driver are you using when you upload code to the esp32 from VSCode?
Hi.
It depends on the board.
It can be the CP2101 or CH340 driver. These are the same if you’re using Arduino IDE. You don’t need to install them specifically for VS Code if you have already installed them for Arduino IDE.
As for the other error, I couldn’t find any information about that issue…
Do you have any more details?
Regards,
Sara
Hi.
It depends on the board.
It can be the CP2101 or CH340 driver. These are the same if you’re using Arduino IDE. You don’t need to install them specifically for VS Code if you have already installed them for Arduino IDE.
As for the other error, I couldn’t find any information about that issue…
Do you have any more details?
Regards,
Sara
I’m running the CP210x driver, and no success. I’m going to try going back to Win 10 and see if that will work
Yes, it does. I’ll have use the Arduino IDE until I can find a solution for using VSCode.
I prefer the VSCode IDE, but it will have to wait.
If Arduino IDE is working, at least we know that it is not an issue with the USB drivers.
Unfortunatley, I don’t know what else I can do to help troubleshoot this issue. Meanwhile, if you find more information, please share.
Regards,
Sara
This is really bizarre.
I’ve tried using VSCode & PlatformIO on 2 different Win 11 computers, and on 3 different Ubuntu machines. The error is the same in all cases.
I will share any new discoveries, and I hope that you will as well.
thanks for trying!
Joel
Hi Sara,
After VERY carefully reading the instructions, I got VSCode to upload code to the board. I was trying to upload by using the RUN> START DEBUGGING command in the VSCode menu bar instead of the UPLOAD command in the PlatformIO menu. Proof that men don’t read instructions!!!
On to the next problem!
Joel