I, too am having problems opening the serial port from Visual Studio. The problem occurs with M5Stack ESP32 device in debug mode.
I *am* able to connect to the M5Stack ESP32 in release mode, however initially nothing ever displays; I always need to manual click "rts" to actually have serial data display.
I *am* able to connect to Adafruit Feather 32u4 in *both* debug and release modes.
My M5Stack ESP32 (*edit2) serial port is Silicon Labs CP210x USB to UART Bridge (COM4) 11/15/2017 Version 10.1.1951
My 32u4 (*edit2) serial port simply says "USB Serial Device (COM8)" in device manager. Apparently default Microsoft drivers. 6/21/2006 (yes, '06!) Version 10.0.16299.15
*edit 2 - this may be the same issue as:
http://www.visualmicro.com/forums/YaBB.pl?num=1514411767/ During debug compile-time, the ESP32 complains with:
VM_Boards.h: 653:2: error: #error "Please edit Boards.h with a hardware abstraction for this board"
#error "Please edit Boards.h with a hardware abstraction for this board"
for (analogPin = 0; analogPin < TOTAL_ANALOG_PINS; analogPin++)
and at the end:
Error compiling libraries
Debug Build Error: This hardware might not support the default Visual Micro Debugger.
If this project is using OTA/WiFi upload then please use the vMicro>Debugger menu to set the Serial COM and Remote port for the debugger.
Otherwise switch the toolbar from 'Debug' to 'Release' and build again.
or switch off Automatic Debugging
or configure the SoftwareSerial debugger option.
Debug build failed for project 'M5StackConsole'
curiously, I have only one Boards.h file on my entire computer, located in:
C:\Program Files (x86)\Arduino\libraries\Firmata
but it would seem unlikely that VisualMicro is including this one for ESP32 or 32u4, so perhaps the proper Boards.h file is simply missing? Or a different M5Stack USB driver?
Help-About:
Microsoft Visual Studio Enterprise 2017
Version 15.5.6
VisualStudio.15.Release/15.5.6+27130.2027
Microsoft .NET Framework
Version 4.7.02556
Visual C# 2017 00369-90250-38212-AA522
Microsoft Visual C# 2017
Visual C++ 2017 00369-90250-38212-AA522
Microsoft Visual C++ 2017
Arduino for Visual Studio 1.0
Tools-Extensions and Updates:
Arduino IDE for Visual Studio 2/10/2018
Version 1801.27.0
*edit: added USB driver dates and version info
*edit(2): fixed mixed up USB driver text for ESP32 vs 32u4.