VS Arduino | |
Visual Micro >> Usb/Serial/WiFi Debugging >> Upload-error in VS with VM, but works OK in Arduino IDE
https://www.visualmicro.com/forums/YaBB.pl?num=1574108400 Message started by gj on Nov 18th, 2019 at 8:20pm |
Title: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 18th, 2019 at 8:20pm
I have this simple sketch that uploads perfectly using Arduino IDE V1.8.9, but gives error in VS2017 (Community, V15.9.17) using Visual Micro (v19.0).
I'm using a Nano with the CH340-chip. I have the driver from CH341SER.EXE installed. Since the uploading works flawlessly in the Arduino IDE, but not in VS/VM I'm assuming the problem is not with the hardware but with VM. Code (c++):
Error: avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x09 https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Upload-Error_002.txt ( 37 KB | 2
Downloads )
|
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Nov 18th, 2019 at 8:30pm
Please try with compile and upload with the tool bar set to Release instead of Debug.
If that still fails you can see the upload command at the end of the trace Does it work fro the cmd prompt? [code]"D:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" "-CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\****\AppData\Local\Temp\VMBuilds\Test\NANO_A~1\Debug/Test.ino.hex:i"[/code] |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 18th, 2019 at 8:49pm
[code]C:\Users\****>"D:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" "-CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\****\AppData\Local\Temp\VMBuilds\Test\NANO_A~1\Release/Test.ino.hex:i"
avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "D:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" Using Port : COM6 Using Programmer : arduino Overriding Baud Rate : 57600 avrdude: ser_open(): can't open device "\\.\COM6": Access is denied. avrdude done. Thank you.[/code] |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Nov 18th, 2019 at 8:51pm
That failed because the port is open and being used. Maybe arduino ide or vs has serial monitor open?
|
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 18th, 2019 at 8:57pm
[code]
C:\Users\****>"D:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" "-CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\****\AppData\Local\Temp\VMBuilds\Test\NANO_A~1\Release/Test.ino.hex:i" avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "D:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" Using Port : COM6 Using Programmer : arduino Overriding Baud Rate : 57600 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x43 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x43 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x43 ^C C:\Users\****>[/code] |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Nov 18th, 2019 at 9:00pm
Thanks that shows avrdude is failing.
I think you have verbose upload enabled in the arduino ide. Please upload and copy/paste the upload command into this thread. You can highlight and copy the output from arduino using mouse to highlight and keyboard to copy. |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 18th, 2019 at 9:08pm Code (]D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM6 -b115200 -D -Uflash:w:C:\Users\****\AppData\Local\Temp\arduino_build_653940/Test.ino.hex:i [/code):
|
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Nov 18th, 2019 at 9:16pm
Well let's ignore that last issue in arduino for now because it is unrelated.
The issue you have with vm and infact with the external avrdude program might be one of two things. Arduino sometimes has a random upload bug due to some program size mangic number. Did you confirm the issue happens in Visual Micro in release mode. Your initial post was in debug mode. That can be one way to alter the program size. I also note that you have a chinese usb driver installed instead of the one that is installed by the arduino ide. Is that intentional? This type of issue is closly related to usb driver. tip: The usb drivers are in a sub folder called \drivers below the arduino ide. When the board is connected you can use device manager to update the usb driver from that location. |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 18th, 2019 at 9:33pm
Compiling in either Debug or Release shows:
[code] D:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\****\AppData\Local\Temp\VMBuilds\Test\NANO_A~1\Debug/Test.ino.hex:i" The specified executable is not a valid application for this OS platform. [/code] The chinese driver CH341SER was advised by many people across forums having the same (or similar) issue. |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Nov 18th, 2019 at 11:07pm
That would probably work but it's missing the quotes around the avrdude program at the start
I know this issue can be an inherent problem for some users and sadly it's unrelated to visual micro or we could do something about it. I think in the past a few things have been established by some users... 1) Sometimes hitting a magic program size number. Adding a little more code can solve the issue. 2) Sometimes using a different avr version can resolve the issue. For example installing the latest arduino 1.8.10 might solve the issue or even using one of the the zip downloads for an older arduino ide such as 1.8.6 might solve the issue. You can use the zips from arduino.cc to install as many arduino versions as you want to try. 3) Sometimes a different usb cable can help but the fact that it works from the arduino ide suggests it's a slightly different end result program size. It might be useful to note that visual micro uses the avr toolchain that is installed with the arduino IDE and each provides a slightly different avr version. I doubt it really matters which you use. |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by gj on Nov 20th, 2019 at 11:17am
Ok, I uninstalled Arduino IDE and VS2017.
Then reinstalled VS2017, VM-extension and Arduino IDE. And it's uploading. No idea as to why this suddenly stopped working. Thanks for your support. You guys (and gals?) are so quick to respond. Really good. :D And that's just one of the reasons I chose to buy your product in the past. So, now back to the original project I was working on when upload-stuff started to break down on me. :) |
Title: Re: Upload-error in VS with VM, but works OK in Arduino IDE Post by Visual Micro on Jan 6th, 2020 at 9:06pm
Thanks, I suspect that when you installed the arduino ide it was a newer version. They have been at arduino adding new toolchains. I guess the newer avrdude.exe uploader tool is happier with your usb driver/cables/something.
[code]C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude [/code] |
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2024. All Rights Reserved. |