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) Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore (Read 8381 times)
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Feb 9th, 2018 at 11:23am
Print Post  
Hi,

upload to Arduino Leonardo (Pro Micro clone) on my PC stopped working for no reason today (no changes were made, computer was left running during night without attention). I think, there is a problem with Leonardo reset now. There is a new message during upload:

"Unable to auto-reset: COM3 . Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload."

But upload with Arduino IDE (1.69 and 1.83) still works fine. When I manually open and close COM3 port at 1200 bauds, Leonardo resets correctly (Windows Device Manager shows for a while "Arduino Leonardo bootloader (COM4)". When I'am uploading code with Arduino IDE, there is for a while "Bootloader COM4" in Windows Device Manager too. But when I run upload in VS Micro now, then no reset is made, no COM4 visible in DM.

I have VS2015 Community. 

PC was restarted, latest VSMicro installed, Leonardo on different COM port connected, fresh Leonardo bootloader flashed, different .ino scripts was tryed ... still same result and error.

It's strange. Any idea what to do?

Regards. G.






  
Back to top
 
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #1 - Feb 9th, 2018 at 1:51pm
Print Post  
Hi, 

after while, the Arduino IDE do the same error (not resetting board - so it is probably not VSMicro thing). I think the bug is watchdog related:

http://forum.arduino.cc/index.php?topic=401628.msg2782592#msg2782592

Enabling watchdog and upload code to Leonardo was my latest yesterday action...

I altered code in CDC.cpp and Arduino IDE auto-reset and upload is working fine now (even with wdt_enable). 

But VSMicro still stuck on "auto-reset" error for now Sad 

G.


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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #2 - Feb 9th, 2018 at 4:41pm
Print Post  
What is the date and name of the usb driver in control panel >device manager?
  
Back to top
WWW  
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #3 - Feb 9th, 2018 at 6:44pm
Print Post  
Arduino Leonardo (COM3)

- Arduino LLC (www.arduino.cc)
- Date: 24.11.2015
- Version: 1.2.3.0

VSMicro upload log:

Uploading 'BLINKY_RESET_TEST' to 'Arduino Leonardo' using 'COM3 '
Uploader started for board Arduino Leonardo
Upload method will be: bootloader
Uploading via Bootloader 
Unable to auto-reset: COM3 . Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.

PORTS {COM1,COM3,COM3,COM3,COM3} / {COM1,COM3,COM3,COM3,COM3} => {}
PORTS {COM1,COM3,COM3,COM3,COM3} / {COM1,COM3,COM3,COM3,COM3} => {}
PORTS {COM1,COM3,COM3,COM3,COM3} / {COM1,COM3,COM3,COM3,COM3} => {}

After PC restart - less COMs, but auto-reset still not working:

Uploading 'BLINKY_RESET_TEST' to 'Arduino Leonardo' using 'COM3 '
Uploader started for board Arduino Leonardo
Upload method will be: bootloader
Uploading via Bootloader 
Unable to auto-reset: COM3 . Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.

PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
  
Back to top
 
IP Logged
 
Johnex™
Junior Member
**
Offline


Posts: 10
Joined: Feb 2nd, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #4 - Feb 9th, 2018 at 8:21pm
Print Post  
Galen im using the Pro Micro too, try using the Sparkfun drivers instead of the arduino ones?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #5 - Feb 9th, 2018 at 9:16pm
Print Post  
I'm using the same driver on win10 without issue so please try the following

Are you trying in Release or Debug mode.

Open the visual micro serial monitor on the com port with any speed except 1200 baud

Then try the upload.

After the upload the serial monitor should reconnect at the non-1200 spead

Then try the upload again

Thanks


I am trying to see if this article is out issue however as I have said it is not an issue for me so difficult for me to test.
https://github.com/sudar/Arduino-Makefile/pull/37


« Last Edit: Feb 9th, 2018 at 9:28pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #6 - Feb 9th, 2018 at 10:00pm
Print Post  
Thanks for reply, tryed now, but with same result (Arduino IDE 1.5.6-r2, 1.6.9 and 1.8.3 are OK), VSMicro auto-reset doesn't work. It worked well with previous Arduino drivers, then i started messing with Leonardo watchdog, after that i had problem in VSMicro with auto-reset before upload, then in Arduino IDE (after same sketch upload). Fixed CDC.cpp, Arduino IDEs are OK. VSMicro auto-reset not. 

It looks like the VSMicro doesn't try to work with COM3 port anymore, because i can still reset Leonardo from other utils (opening COM3 at 1200 -> resets Leonardo and Bootloader COM4 is visible).

2Visual Micro: Tryed both (Debug, Release). No problem with connecting Serial monitor before upload, then same error and no auto reconnect.

Opening port
Port open

Port closed
Uploading to I/O board
....
[cannot auto-reset board -> error]
....
No auto reconnect, but when i click to Connect button:

Opening port
Port open

[Connected]
  
Back to top
 
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #7 - Feb 9th, 2018 at 10:42pm
Print Post  
Code below resets Leonardo for VSMicro on my machine (for a test)... nothing special. 

Unable to auto-reset: COM3 . Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.

PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {}
PORTS {COM1,COM3} / {COM1,COM3} => {} At this moment was started code below
PORTS {COM1,COM3} / {COM1} => {}
PORTS {COM1} / {COM1,COM4} => {COM4}
C:\Arduino183\hardware\tools\avr\bin\avrdude "-CC:\Arduino183\hardware\tools\avr/etc/avrdude.conf" -v -patmega32u4 -cavr109 -PCOM4 -b57600 -D INKY_RESET_TEST.ino.hex:i"
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
...
[UPLOAD OK]


SerialPort serialPort = new SerialPort("COM3");
            try
            {

                serialPort.PortName = "COM3";
                serialPort.DataBits = 8;
                serialPort.Parity = Parity.None;
                serialPort.StopBits = StopBits.One;
                serialPort.BaudRate = 1200;
                
                //serialPort.DtrEnable = false; //doesn't matter

                serialPort.Open();                
                serialPort.Close();
                
            } catch (Exception ex)
            {

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #8 - Feb 10th, 2018 at 1:05am
Print Post  
The attached visual studio project allows you to enter a port name and attempt to trigger bootloader mode.

The project is also pre-buildi into .exe which is located in the bin/debug folder.

Please try to upload with visual micro until you see the error. Keep the serial monitor closed. Then run the exe and see if it can trigger bootloader.

Also try to run the .exe after hard reset of the leonardo and see if you can trigger the bootloader more than once.

You will see the "known c#" ports in the lower part of the screen, will see a new port appear if the bootloader triggers and then it will disappear after after a few seconds and return to normal port.

Thanks
  

Please Register or Login to the Forum to see File Attachments
Back to top
WWW  
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #9 - Feb 10th, 2018 at 9:05am
Print Post  
Hi,

you code works (sometimes there is "A device attached to the system is not functioning" exception, not a big deal). I was fooled by the wdt CDC bug in Arduino, i found finally small bug in vMicro now. Please try:

Start VS2005 -> vMicro -> New Arduino Project 

Now please check "Project Project properties" - Upload Port / IP. 

Check if there is "COM3" or "COM3 " (string with space character at the end, click in the textbox)

If it is "COM3 " (with space) delete space. 

Try pulldowns for port changing (vMicro -> Uploader -> Port or IP) or the pulldown on the top left corner of the Visual Studio window (both make this error). Change port to another COM and back. Now check Project Properties, there is space again!

With space character at the end is no auto-reset executed.

G.
« Last Edit: Feb 10th, 2018 at 9:36am by Galen »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #10 - Feb 10th, 2018 at 1:54pm
Print Post  
Hi,

Did you manually enter the IP address or did you select it from the list?
  
Back to top
WWW  
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #11 - Feb 10th, 2018 at 3:05pm
Print Post  
COM port was always selected from the list (see image). 

https://justpaste.it/1gww5

MS has also a strange bug there, but in your testcode were COM port names right.
https://stackoverflow.com/questions/32040209/serialport-getportnames-returns-inc...

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #12 - Feb 10th, 2018 at 7:08pm
Print Post  
Interesting.

The windows com port system is a nightmare and does get supplemented by windows management system lookup for certain missing devices. It's possible the name from the lookup overwrites the ones from the GetPorts(). It also has to lookup descriptions at the same time.

Can you try switching off "Network discovery, "Friendly Ports List" and "Friendly Port Menus" in "Tools>Options>Visual Micro>Communications". Then restart the IDE and see if it works correctly.

This will help me zero into where the issue is. Then I think I can strip the garbage and fix it.
  
Back to top
WWW  
IP Logged
 
Galen
Newbies
*
Offline


Posts: 8
Joined: Feb 9th, 2018
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #13 - Feb 10th, 2018 at 8:33pm
Print Post  
Switched off & IDE restarted. It's OK now.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Leonardo upload doesn't work for no reason, VSMicro not resetting Leonardo board anymore
Reply #14 - Feb 11th, 2018 at 12:55am
Print Post  
Okay thanks. 

This suggests your WMI (windows management information) database is corrupt. It is for many users but usually it just stops returning information.

I'll try to clean the port name up for the next release.

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