Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) SOLVED - Serial Port monitor failed to open port for baudrate other than 9600 (Read 13648 times)
vior
Newbies
*
Offline


Posts: 3
Joined: Dec 27th, 2017
SOLVED - Serial Port monitor failed to open port for baudrate other than 9600
Dec 27th, 2017 at 9:56pm
Print Post  
Hi! 
In my vmicro I have a very strange behavior of the serial monitor. When trying to connect with speeds different from 9600, it can not open the communication port

os - win 10 Pro
studio - vs2015 community
device - ESP-WROOM-32, usb Silicon Labs CP210x USB to UART Bridge

Program upload is ok. And the Arduino IDE 1.8.5 built-in serial monitor works fine with any baudrates for this port.

Here is screencast, https://www.screencast.com/t/xXyVZusCt
« Last Edit: Jan 5th, 2018 at 9:51pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #1 - Dec 28th, 2017 at 10:59pm
Print Post  
Hi,

It probably won't help but until you have a proven system please make sure you are uploading and testing with the tool bar set to "Release" and not "Debug".

  
Back to top
WWW  
IP Logged
 
vior
Newbies
*
Offline


Posts: 3
Joined: Dec 27th, 2017
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #2 - Dec 29th, 2017 at 7:52am
Print Post  
I tried to test in both configurations.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #3 - Dec 29th, 2017 at 2:31pm
Print Post  
That's very strange. It's windows that is killing the connection as if it doesn't like the usb driver. There are a lot of people using the same system and have done for about 8 years but never with this issue.

I just tried an esp32 and my driver/port shows the same as yours but works fine.

In device manager what is the date and version of the CP210 USB to UART bridge?

There us a difference between vm and arduino simply that arduino uses java to access the port but visual micro uses the microsoft c# methods (System.IO).
  
Back to top
WWW  
IP Logged
 
vior
Newbies
*
Offline


Posts: 3
Joined: Dec 27th, 2017
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #4 - Dec 29th, 2017 at 6:40pm
Print Post  
Thank you for your direction.
I solved this problem.
The problem was in the device driver, I originally installed the driver, 
Silicon Labs CP210x USB to UART Bridge 11/15/2017 10.1.1.1951
Designated as "Download for Windows 10 Universal (v10.1.1)"

https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver...

Now I tried to install "Download for Windows 7/8/8.1/10 (v6.7.5)" https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip and the monitor worked fine.
« Last Edit: Jan 5th, 2018 at 9:52pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #5 - Dec 30th, 2017 at 8:11pm
Print Post  
Great thanks for letting me know
  
Back to top
WWW  
IP Logged
 
goj immypi
Junior Member
**
Offline


Posts: 14
Joined: Jan 20th, 2017
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #6 - Jan 3rd, 2018 at 10:48am
Print Post  
vior wrote on Dec 29th, 2017 at 6:40pm:
The problem was in the device driver, I originally installed the driver, 
Silicon Labs CP210x USB to UART Bridge 11/15/2017 10.1.1.1951
Designated as "Download for Windows 10 Universal (v10.1.1)"
https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver....

Now I tried to install "Download for Windows 7/8/8.1/10 (v6.7.5)" https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip and the monitor worked fine.


this was my exact problem (and somewhat of a solution) for my ESP32 m5stack board in Visual Micro.

I was able to connect and upload release versions with no problem using CP10.1.1.1951 , but the debugger setting could never connect. (however I was able to connect with putty using same params, just not from Visual Studio).

Forcing the old 6.7.5 drivers fixed the debugger connection problem, but now I cannot upload, getting this error:

Code
Select All
C:\Users\gojimmypi\Documents\Arduino\hardware\espressif\esp32\tools\esptool.exe --chip esp32 --port "COM4" --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 ~1.BIN 0x1000 1.BIN 0x10000 C:\Users\GOJIMM~1\AppData\Local\Temp\VMBuilds\M5\ESPRES~1\Debug/M5INO~1.BIN 0x8000 C:\Users\GOJIMM~1\AppData\Local\Temp\VMBuilds\M5\ESPRES~1\Debug/M5INOP~1.BIN
esptool.py v2.1
___....._____....._____....._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
esptool.py v2.1
___....._____....._____....._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
 



yet still putty can connect with no problem. So this really looks like a Visual Micro problem, no?

Microsoft Visual Studio Enterprise 2017 
Version 15.5.2
VisualStudio.15.Release/15.5.2+27130.2010
Microsoft .NET Framework
Version 4.7.02556

Visual Micro 12/16/2017 release version 1711.19.0
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #7 - Jan 5th, 2018 at 9:51pm
Print Post  
I think it's slightly different but very interesting. The debugger does normally enabled DTR but avoids doing so with esp8266 because it causes the board to go into boorloader mode. For other arduino boards the DTR is the way to force a reset. It's possible that visual micro is attempting to set the DTR for the esp32 which might cause an issue.

Your report shows it is the esp tool that is failing to connect to the board. Therefore the board must be in the wrong mode.

If this is all true then your report suggests that the DTR is ignored in the earlier usb driver. This thread was about the windows 10 usb driver failing on an older version of windows so that why I think it is different.

You can switch off the delayOrDTR option in the visual micro F4 project properties tool window. This would prove the issue either way.

The only other thing might be timing. The new usb driver might need a long delay between allowing esptool.exe port access for upload v's port access via c# serial debugger.

I will try the esp32 myself. Being a new board it has not had much testing yet but do please open new threads with any reports.

Thanks

  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SOLVED - Serial Port monitor failed to open port for baudrate other than 9600
Reply #8 - Jan 10th, 2018 at 4:41pm
Print Post  
Off-Topic replies have been moved to this Topic.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SOLVED - Serial Port monitor failed to open port for baudrate other than 9600
Reply #9 - Jan 27th, 2018 at 11:53pm
Print Post  
Thanks for the report and info @vior

More info ....

I have tested the SiliconLabs CP210x usb driver version 10.1.1.1951 on windows 10 and it fails to work with standard Microsoft C#

The driver throws an error suggesting it can only work with a baud rate of 9075

If you create a new windows forms c# project containing button1 and textBox1 then paste in the code below. Change the port from COM8 to your port you will see the problem.

Notice the baudRate iis set to 9075. Anything faster throws an error.

This is a driver issue however the fact that java from the arduino ide reads the port okay is annoying. I will investigate an alternative port reader but what we use is recommended by microsoft and well tried and tested (until recently)

Having said that. The 10.1 version is listed for windows universal and v6.7 listed for all other windows versions such as win10, win8, win7 etc.

https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vc...

Code
Select All
using System;
using System.Windows.Forms;

namespace WindowsFormsApp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        System.IO.Ports.SerialPort sp;

        private void button1_Click(object sender, EventArgs e)
        {
            sp = new System.IO.Ports.SerialPort("COM8");
            sp.BaudRate = 9075;
            // sp.BaudRate = 115200;
            sp.DtrEnable = false;
            sp.RtsEnable = false;
            sp.DataBits = 8;
            sp.StopBits = System.IO.Ports.StopBits.One;
            sp.Handshake = System.IO.Ports.Handshake.None;
            sp.Parity = System.IO.Ports.Parity.None;
            sp.ReadTimeout = 10;
            try
            {
                sp.Open();
                //sp.BaudRate = 115200;
                while (true)
                {
                    while (sp.BytesToRead > 0)
                    {
                        textBox1.AppendText(sp.ReadExisting());
                        Application.DoEvents();

                    }


                   System.Threading.Thread.Sleep(200);
                }
            }
            catch (Exception ex) {
                textBox1.AppendText(ex.ToString());
                System.Threading.Thread.Sleep(5000);
            }
            Application.Exit();
        }
    }
}
 

« Last Edit: Feb 14th, 2018 at 9:42pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Germán Martín
Newbies
*
Offline


Posts: 8
Joined: Apr 6th, 2016
Re: Serial Port monitor failed to open port for baudrate other than 9600
Reply #10 - Dec 24th, 2018 at 1:03pm
Print Post  
Same issue here. Thank you for the advise.

vior wrote on Dec 29th, 2017 at 6:40pm:
Thank you for your direction.
I solved this problem.
The problem was in the device driver, I originally installed the driver, 
Silicon Labs CP210x USB to UART Bridge 11/15/2017 10.1.1.1951
Designated as "Download for Windows 10 Universal (v10.1.1)"

https://www.silabs.com/documents/public/software/CP210x_Universal_Windows_Driver...

Now I tried to install "Download for Windows 7/8/8.1/10 (v6.7.5)" https://www.silabs.com/documents/public/software/CP210x_Windows_Drivers.zip and the monitor worked fine.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint