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) Uploading to I/O board using '..' then stalls. (Read 18013 times)
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Uploading to I/O board using '..' then stalls.
Nov 25th, 2013 at 2:00pm
Print Post  
Hi,
Havn't seen it work yet - but been trying for days.

I'm having trouble uploading sketches with atmel studio 6.1 
and also tried the latest beta.

* I've tried Arduino IDE latest 1.5 Beta but currently Im back to using V1.0.5
* I've tried both Visual Studio 2010 and atmel studio 6.1 - both have same problem
* I have set up correctly the paths to Arduino IDE
* I have tried uploading via both Bootloader and an ISCP AVR programmer
* Tried resetting the board when uploading - no effect.

Problem is in all cases - the code compiles ok - but it stalls at the part where avrdude is to be called.

The hex file is produced ok (BlinkSimple.hex)
Filemon shows no attempt at calling avrdude.
No lights flicker on the Arduino.
There are no errors in the ApplicationStatus.log
(just ends with lots of
13:54:40.453: cmd grp : {guid here}, cmdid : 339)


Works as expected in Arduino IDE - 

comport Com20.
OS is XP.
Leonardo


[code]Compiling 'BlinkSimple' for 'Arduino Leonardo'
Build folder: %20Data/VMicro/Arduino/Builds/BlinkSimple/leonardo
SketchLibFolders
nclude\;
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: VISUALMICRO_COMPILER_VER=1;
Architecture Tools: C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///C:/Projects/Arduino/
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -DF_CPU=16000000L -MMD -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DARDUINO=105 -I"C:\Projects\Arduino\arduino-1.0.5\hardware\arduino\cores\arduino" -I"C:\Projects\Arduino\arduino-1.0.5\hardware\arduino\variants\leonardo" -o "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp.o"  "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp"  -DVISUALMICRO_COMPILER_VER=1
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega32u4 -L"C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo" -o "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp.o" "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\core.a" -lm
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.eep"
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\LocalUserName\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.hex"
Binary sketch size: 4826 bytes (used 17% of a 28672 byte maximum) (0.20 secs)
Uploading to I/O board using 'usbasp'[/code]

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #1 - Nov 25th, 2013 at 2:23pm
Print Post  
Hi,

Sorry you are having a problem. Would you please post the output when you attempt to upload using normal serial.

Thanks
  
Back to top
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #2 - Nov 28th, 2013 at 2:27am
Print Post  
Not sure while log you need - hope this covers it...

Board Properties
name=Arduino Leonardo
upload.protocol=avr109
upload.maximum_size=28672
upload.speed=57600
upload.disable_flushing=true
bootloader.low_fuses=0xff
bootloader.high_fuses=0xd8
bootloader.extended_fuses=0xcb
bootloader.path=caterina
bootloader.file=Caterina-Leonardo.hex
bootloader.unlock_bits=0x3F
bootloader.lock_bits=0x2F
build.mcu=atmega32u4
build.f_cpu=16000000L
build.vid=0x2341
build.pid=0x8036
build.core=arduino
build.variant=leonardo
runtime.ide.path=C:\Projects\Arduino\arduino-1.0.5\
build.system.path=C:\Projects\Arduino\arduino-1.0.5\hardware\arduino\system
runtime.ide.version=105
originalid=leonardo
vm.core.include=arduino.h
vm.boardsource.path=C:\Projects\Arduino\arduino-1.0.5\hardware\arduino
vm.platformname.name=avr
build.arch=AVR
ide.hint=Arduino 0023 and 1.0.x Ide
ide.location.key=Arduino
ide.location.ide.winreg=Arduino 1.0.x Application
ide.location.sketchbook.winreg=Arduino 1.0.x Sketchbook
ide.location.sketchbook.preferences=sketchbook.path
ide.location.sketchbook.default=%MYDOCUMENTS%\arduino
ide.location.preferences=%APPDATA%\arduino\preferences.txt
ide.default.package=arduino
ide.default.platform=avr
ide.multiplatform=true
ide.includes=arduino.h
ide.platformswithoutpackage=true
ide.sketchfolder.platforms.exclude=avr
ide.includes.fallback=wprogram.h
ide.extension=ino
ide.extension.fallback=pde
ide.versionLTEQ=149
ide.exe=arduino.exe
ide.hosts=atmel
ide.url=http://arduino.cc/en/Main/Software
vm.debug=true
software=ARDUINO
ide.appid=arduino10x
location.sketchbook=C:\Projects\Arduino\


(continued next post)
  
Back to top
 
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #3 - Nov 28th, 2013 at 2:27am
Print Post  
This build would be faster if you purchased the Visual Micro additional features pack http://wwww.visualmicro.com (ctrl+click the link)
Compiling 'BlinkSimple' for 'Arduino Leonardo'
Build folder: Micro/Arduino/Builds/BlinkSimple/leonardo
SketchLibFolders
nclude\;
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: VISUALMICRO_COMPILER_VER=1;
Architecture Tools: C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///C:/Projects/Arduino/
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -DF_CPU=16000000L -MMD -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DARDUINO=105 -I"C:\Projects\Arduino\arduino-1.0.5\hardware\arduino\cores\arduino" -I"C:\Projects\Arduino\arduino-1.0.5\hardware\arduino\variants\leonardo" -o "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp.o"  "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp"  -DVISUALMICRO_COMPILER_VER=1
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega32u4 -L"C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo" -o "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.cpp.o" "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\core.a" -lm
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.eep"
C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.elf" "C:\Documents and Settings\user\Local Settings\Application Data\VMicro\Arduino\Builds\BlinkSimple\leonardo\BlinkSimple.hex"
Binary sketch size: 4826 bytes (used 17% of a 28672 byte maximum) (0.33 secs)
Uploading to I/O board using 'COM10'
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #4 - Nov 28th, 2013 at 12:59pm
Print Post  
Thanks for the output. The first output was the correct one Smiley

I haven't seen a problem with serial upload to leonardo before. Notice that for the upload the leonardo appears briefly as COM10. Please open device manager and confirm the name of the usb driver that is being used on COM10

Please also confirm the if you are using a standard usb cable or serial/usb converter.

Thanks
  
Back to top
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #5 - Dec 16th, 2013 at 11:55am
Print Post  
Tim@Visual Micro wrote on Nov 28th, 2013 at 12:59pm:
Please open device manager and confirm the name of the usb driver that is being used on COM10

Please also confirm the if you are using a standard usb cable or serial/usb converter.

Thanks



Thanks - but im not getting very far....
Two issues now:

1) Thanks - but yes - the com port is ok - its the same as the one I was using for the Arduino IDE - and that worked ok.
The cable is a good one and works in Arduino IDE ok. The issue is it just doesn't even try access port - if does not load avrdude.

Filemon shows it did not attempt to load avrdude

I can call avrdude on the command line after I compile and it uploads fine - but this means no debugging.


I've reinstalled 4 times now - tried both 
ArduinoForAtmelStudio[6.1].msi
ArduinoForVisualStudio[6.1].msi

I installed it on a loaned Windows8 machine - and it worked on that - but I need it on my machine - Could it be XP is the issue here?


2) How do you add extra include directories - Im trying compile a program I wrote that uses a third party library "EtherCard.h" 

- it compiles file in Arduino IDE 
- the include directories are visible in the properties of the Arduino for Visual Studio project.

but when compiling in ArduinoForVisualStudio or ArduinoForAtmelStudio the call to the compille - this line: - has only 3 -I include folders - and the build fails.

C:\Projects\Arduino\IDE\hardware\tools\avr\bin\avr-g++

how do you add more include directories to these 3 - any new ones seem to be getting ignored - thanks   Huh

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #6 - Dec 16th, 2013 at 12:41pm
Print Post  
Hi,

Please ignore all of the Atmel project properties they are used purely for intellisense purposes. The Atmel intellisense doesn't refresh very well so Visual Micro ensures that it knows about all Arduino libs even when they are not included in the sketch.

You have set your board type to be Leonardo. Is this the board you have?

I suggest we prove the compile and upload works with a simple sketch such as the blink sketch.

Once we have compile and upload for Blink we can look at why the ethernet lib is not included correctly in your sketch.

Thanks for the great info.
« Last Edit: Dec 16th, 2013 at 8:03pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #7 - Dec 16th, 2013 at 8:02pm
Print Post  
More..

Hi ozmo

I'm sorry you have hit a few issues we have under gone some large updates in the last versions of Visual Micro. However the upload problems you report are not issues reported by others. Although we will be testing hardware programmers some more the serial upload is well tested in the recent versions.


If it's okay with you I have removed your two posts about the ethernet library problems. I would like to deal with those in a separate post because they might cause the upload issues to be overlooked. 

Can we first try to understand the problem with normal serial upload to an Arduino on your COM10? 

1)
Can you please confirm if you have the serial window open during upload?

2)
Confirm the name of the usb driver that shows for the leonardo in control panel device manager? Also the date of the driver so that we can closley replicate your configuration

3)
If you click the reset button on the Leonardo when the "Uploading" message appears does the upload then work?

Thanks
« Last Edit: Dec 16th, 2013 at 8:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #8 - Dec 19th, 2013 at 4:16am
Print Post  
Hi - thanks for looking at this for me - sorry didnt get back earlier - had Flu...  - oh and yes the other problem would best be delt with separately.


My configuration is a Leonardo - an XP machine (decent spec- SSD drive - 4G ram etc - I just prefer XP for development - less in the way) - issue is repeatable with no other usb devices attached except keyboard and mouse.

1) Can you please confirm if you have the serial window open during upload?

Not open - dont use it - Because the way the Leonardo port hops (there is one software port that is eg. Com3 normally - and eg. Com4  for 4 seconds after a reset (to allow uploading) -(number varies depending on which pc usb port I have it plugged into) so its very difficult to use the built in serial for debugging - you cannot have it open at the start as when you reset or upload the port disappears and leaves the port and monitor (eg. Hyperterminal) in an unstable state requiring a device driver reinstallation! This is the main reason why I would like to use your debugger - so I don't have to use the serial monitor method of debugging.
(What I have tried is using Serial1.print (instead of Serial.print) and hook up the Pin0 & Pin1 to a usb -> serial adapter I have) this works very well.
But the problem happens even if I use the simple Blink example with no serial commands and no modifications and no serial monitoring.


2)Confirm the name of the usb driver that shows for the leonardo in control panel device manager? Also the date of the driver so that we can closley replicate your configuration

Thanks - 



3) If you click the reset button on the Leonardo when the "Uploading" message appears does the upload then work?

No - the leonardo does its reset thing (pulsing lights) - but the TX and RX lights dont flash like the do during an upload.

The Hex file is created ok - because I can manually run avrdude to complete the process and upload the successfully compiled code - it was a hassle to work out - Ill post my workaround in the next post.


 

« Last Edit: Dec 19th, 2013 at 5:09am by ozmo »  
Back to top
 
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #9 - Dec 19th, 2013 at 4:36am
Print Post  
Soo - heres my workaround to call avrdude - not just a simple command line, as first you have to kick Leonardo into killing the normal port and creating the Upload Com port...

I have assigned it as an external tool - and after compiling and see it freeze at the uploading stage - I run this then.

Its DotNet console app I put together...

Not perfect because while it lets me code in a decent environment and upload - it does not allow debugging...which I need to get my other ethercard problem sorted :)



[code]using System;
using System.Text;
using System.IO;
using System.IO.Ports;
using System.Threading;
using System.Diagnostics;

namespace avrdudeEx
{
     class Program
     {
           static string sUSER = "User"; //developer username
           static string sCOM_NORM = "COM3";
           static string sCOM_UPLOAD = "COM4";

           static string avrdudeApp = @"C:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\bin\avrdude.exe";
           static string logFile = @"c:\avrdude.txt";
           static string sTemplate = @"-CC:\Projects\Arduino\arduino-1.0.5\hardware\tools\avr\etc\avrdude.conf -q -v -patmega32u4 -cavr109 -P\\.\"+sCOM_UPLOAD+@" -D -Uflash:w:C:\DOCUME~1\" + sUSER + @"\LOCALS~1\APPLIC~1\VMicro\Arduino\Builds\{0}\leonardo\{0}.hex:i";

           static void Main(string[] args)
           {
                 
                 try
                 {
                       StreamWriter f = File.CreateText(logFile);
                       foreach (object s in args)
                             f.WriteLine(s.ToString());
                       f.Close();

                       //Enter Leonardo Upload mode
                       Reset(sCOM_NORM);

                       //WaitForCom(sCOM_UPLOAD);
                       int n = 0;
                       for(;n<5;n++)
                       {
                             bool bOK = CallAvrDude(args);
                             if (bOK)
                                   break;
                             Thread.Sleep(1000);
                       }

                       Log("\r\nTook:"+n+" tries");
                 }
                 catch (Exception ex)
                 {
                       Log("\r\nError:"+ex.Message);
                 }
           }

           private static void Log(string p)
           {
                 var sw = File.AppendText(logFile);
                 sw.WriteLine(p+"\r\n");
                 sw.Close();
           }

           //call avrdude - ret true if success
           private static bool CallAvrDude(string[] args)
           {
                 string sRun = String.Format(sTemplate, args[0]);
                 Log(sRun);

                 Log("\r\nRun:" + (avrdudeApp + " " + sRun));

                 Process process = new Process();
                 process.StartInfo.CreateNoWindow = true;
                 process.StartInfo.FileName = (avrdudeApp);
                 process.StartInfo.Arguments = sRun;
                 process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                 process.StartInfo.UseShellExecute = false;
                 process.StartInfo.RedirectStandardOutput = true;
                 process.StartInfo.RedirectStandardError = true;
                 process.Start();
                 
                 string sOut = "\r\nOut="+process.StandardOutput.ReadToEnd();
                 sOut += "\r\nError=" + process.StandardError.ReadToEnd();
                 process.WaitForExit();

                 Log(sOut);
                 return !(sOut.Contains("can't open device"));      //"write error:"
           }

           //Enter Leonardo Programming mode
           private static void Reset(string sPort)
           {
                 // Create a new SerialPort object with default settings.
                 SerialPort _serialPort = new SerialPort();

                 // Important Leonardo properties.
                 _serialPort.PortName = sPort;
                 _serialPort.BaudRate = 1200;
                 _serialPort.Parity = Parity.None;
                 _serialPort.DataBits = 8;
                 _serialPort.StopBits = StopBits.One;
                 _serialPort.Handshake = Handshake.None;

                 _serialPort.Open();
                 _serialPort.Close();
           }

           //alternative - instead of repeat calling avrdude - call this.(slower)
           private static bool WaitForCom(string sPort)
           {
                 for (int n = 0; n < 10; n++)
                 {
                       try
                       {
                             // Create a new SerialPort object with default settings.
                             SerialPort _serialPort = new SerialPort();

                             // Allow the user to set the appropriate properties.
                             _serialPort.PortName = sPort;
                             _serialPort.Open();
                             _serialPort.Close();
                             Console.WriteLine("Reset Success");
                             return true;
                       }
                       catch
                       {
                             Thread.Sleep(1000);
                       }
                 }
                 Console.WriteLine("Timeout - Reset did not happen");
                 return false;
           }
     }
}
[/code]



« Last Edit: Dec 19th, 2013 at 5:11am by ozmo »  
Back to top
 
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #10 - Dec 19th, 2013 at 4:47am
Print Post  
Here is what I see - most basic blink example - with only Leonardo - mouse and keyboard attached (no serial monitor)

Pressing "Start without Debugging" Just gets this far - and no flicker on the leonardo.

  
Back to top
 
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #11 - Dec 19th, 2013 at 5:01am
Print Post  
[quote]Please open device manager and confirm the name of the usb driver that is being used on COM10
Please also confirm the if you are using a standard usb cable or serial/usb converter.
[/quote]

So just in case any confusion - always using standard USB cable - never to a hub - direct to desktop pc. 

Was initially on my first post set as COM10/COM6 - but I changed it to COM3/COM4 (normal mode/uploading mode) in case a more standard lower number might help.

As stated above I do have an additional Serial/USB converter I use sometimes as a serial monitor - but it makes no difference removing it and it was removed for the above screenshot to show this.

thanks all.

« Last Edit: Dec 19th, 2013 at 5:12am by ozmo »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #12 - Dec 19th, 2013 at 11:25am
Print Post  
Strange, it's working okay for most people. Vm does all of the auto switch to upload port you have described. It will say uploading to port X then after upload it will confirm what the new upload port was.

Maybe in the next release of Visual Micro this will work better for you. We have altered the timeouts slightly and provided better error messages should it fail and also better verbose reporting.

Sorry you hit a problem, all I can say is that Visual Micro is waiting for the upload port to become available.
« Last Edit: Dec 19th, 2013 at 11:44am by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #13 - Dec 19th, 2013 at 11:53am
Print Post  
(2)

I have just looked at your upload example some more. I see you have hard coded the upload port where as Visual Micro has to work out the port because it changes for each board/user/pc.

This is what Visual Micro is trying to do when it pauses saying "Uploading to port x"

To do this we perform the 1200 baud touch as per your example, then we loop waiting for  System.IO.Ports.SerialPort.PortNames to contain a new port. Time out is after 30 seconds.

We have found that .net can in some instances be slow to refresh System.IO.Ports.SerialPort.PortNames to in the next release we have tried some things to make it more responsive.
  
Back to top
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #14 - Dec 19th, 2013 at 4:21pm
Print Post  
Tim@Visual Micro wrote on Dec 19th, 2013 at 11:53am:
(2)
...we perform the 1200 baud touch as per your example, then we loop waiting for  System.IO.Ports.SerialPort.PortNames to contain a new port. Time out is after 30 seconds.



Thanks 

But should I be seeing then the same problem when using an AVR programmer - see the first screenshot of this thread - no port switching is needed here - but it still freezes up at the same point.

Code
Select All
Binary sketch size: 4826 bytes (used 17% of a 28672 byte maximum) (0.20 secs)
Uploading to I/O board using 'usbasp'  




- I will monitor this on my machine and get back to you what the contents of this are and how quickly the change is reported if you like. 

You mentioned a newer beta version - is there one I can be trying?



Thanks Smiley
« Last Edit: Dec 19th, 2013 at 4:22pm by ozmo »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #15 - Dec 19th, 2013 at 4:32pm
Print Post  
You are right the programmer does not do port switching or use ports so that eliminates that as a problem. 

Visual Micro simply calls avrdude. What happens if you disconnect the usb cable when the upload attempt is happening? Do you then see an error?

I know this sounds like a long shot but maybe a virus checker is preventing Vm from running avrdude. I know the complication works okay for you which also calls other Arduino tool chain programs without issue but it is such a simple system and you have such an obviously repetitive problem I am running out of ideas.

It's not often users provide so much detailed info in the way that you have done. It is a pity that we haven't found the cause!

The next release of vm should be over the next couple of weeks. It does provide more verbose info for the avrdude calls which might help you see that it is trying to do the right things.
  
Back to top
IP Logged
 
ozmo
Junior Member
**
Offline


Posts: 10
Joined: Nov 25th, 2013
Re: Uploading to I/O board using '..' then stalls.
Reply #16 - Dec 19th, 2013 at 8:40pm
Print Post  
Thanks - 

Ok I went offline for a while so I could try with Antivirus uninstalled & firewall off for the test - no difference.

So firewall and antivirus back on.

Trying now using Sysinternals PortMon - when using Arduino IDE I can see the ports switching and I can see data going all as expected

- but with Arduino for AtmelStudio - Nothing - no attempt at port switching or any COM3 port activity at all happens :/



Tried another Leonardo - I have a few here - no difference either


[quote]Visual Micro simply calls avrdude. What happens if you disconnect the usb cable when the upload attempt is happening? Do you then see an error?[/quote]

I disconnected Leonardo - No error - exactly the same - I waited 60 seconds to see if there would be a timeout error - but no - nothing. same as precious screenshot...

"Uploading to I/O board using 'COM3'"

running out of things to try now... so maybe I'll wait for your next version.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to I/O board using '..' then stalls.
Reply #17 - Dec 19th, 2013 at 11:20pm
Print Post  
This is an area that has changed slightly in the next release and hopefully has better error reporting and will not become unresponsive.

I hope it fixes it! From what you have said Visual Micro believes that it has opened the port at 1200 baud and closed it again without receiving any .net exceptions. 

By the sound of it if you push reset the Leonardo drops the port and appears in device manager as a different port for a few seconds but that .net is not IO.SerialPort.PortNames is not changing thus VM keeps waiting due to a timeout bug.

Interestingly, part of the rework in this area was to create a dummy SerialPort object prior to reading the IO PortNames list. This appeared to cause the port names list to refresh more quickly.

I know it's a pain but please use the external editor option in the arduino ide or a batch file to upload until the next release. Sorry the upload from your pc is so affected by this issue. I hate the word "strange" but it is  Sad
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint