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
Normal Topic Cannot upload, because visual studio overrides my system wide configuration file. (Read 9408 times)
Bulow
Newbies
*
Offline


Posts: 3
Joined: Jul 2nd, 2014
Cannot upload, because visual studio overrides my system wide configuration file.
Jul 2nd, 2014 at 9:55pm
Print Post  
Hi. As stated in the title, I cannot get Visual Studio to upload my sketch, because the system wide configuration file is overridden in the commands used for uploading. The following is the output when I try uploading in Visual Studio:

Binary sketch size: 5,504 bytes (used 17% of a 32,256 byte maximum) (0.49 secs)
Minimum Memory Usage: 252 bytes (12% of a 2048 byte maximum)
Uploading to I/O board using 'COM5'
Uploader started for board Arduino Uno
Upload method will be: bootloader
Uploading via Bootloader 
Flushing the serial port
C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin\avrdude "-CC:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin" -v -v -v -v -patmega328p -carduino -PCOM5 -b115200 -D om.hex:i"
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin"
avrdude: can't open config file "C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin": Permission denied
avrdude: error reading system wide configuration file "C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin"


I dug around a bit, and I found out that the problem occurs in the line right after flushing the serial port. The problem is the -CC part, where it sets the configuration file to the folder containing the actual configuration file, and not the file itself (thus overriding the system wide configuration file). I have tried running the same command in cmd without the -CC bit, and it works just fine.

Is there a way to remove this part of the command, or is there another fix that I'm not aware of?

Thanks in advance

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #1 - Jul 2nd, 2014 at 10:08pm
Print Post  
Hi,

Visual Micro supports additional custom hardware settings and we might be falling fowl of these but easily resolved.

The first thing to note is that with arduino 1.5.x versions the commands that Visual Micro uses are as defined in the config installed with the Arduino Ide.

I suspect that what is happening is that all paths are wrong and that Visual Micro is detecting a previous partial installation of the Arduino Ide below your documents folder? I might be wrong but this seems to be the most obvious cause at the moment.

C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2\hardware\tools\avr\bin\avrdude

Q: Is the Arduino Ide installed somewhere like the "c:\program files" folder or is it really below your documents folder?

If C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2 is an invalid install then please remove it and that should fix the problem.

Failing that please run the upload from the arduino ide after switching on "file>preferences>upload verbose". Please post the output

Thanks

  
Back to top
IP Logged
 
Bulow
Newbies
*
Offline


Posts: 3
Joined: Jul 2nd, 2014
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #2 - Jul 2nd, 2014 at 10:41pm
Print Post  
I keep my primary arduino installation in my MEGA folder to keep my libraries synced across my computers, so it is indeed a complete installation. The following is what happens when I try uploading via the IDE (note that though the configuration file is still overridden, it now uses the correct configuration file)

Sketch uses 1,116 bytes (3%) of program storage space. Maximum is 30,720 bytes.
Global variables use 11 bytes (0%) of dynamic memory, leaving 2,037 bytes for local variables. Maximum is 2,048 bytes.
C:\Users\Emil\Documents\MEGA\arduino-1.5.6-r2/hardware/tools/avr/bin/avrdude onf -v -v -v -v -patmega328p -carduino -PCOM5 -b57600 -D p.hex:i 

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is nf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20]
[From here on it just uploads normally]



Just to make sure, I installed the IDE again in program files and edited the paths in the Visual Micro settings. The result was the same.

Which configuration file exactly does the command come from? (I should be able to just fix it in there, right?)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #3 - Jul 3rd, 2014 at 12:10pm
Print Post  
Hi

Can you please switch on "tools>options>visual micro>compiler>show build properties" then attempt upload and email the output to info[at]visualmicro.com. I am intrigued to see the properties.

You will see in the arduino platform.txt config file for avr the following definition which clearly shows the config path being set to tools.avrdude.config.path=

I have some investigation to do because the same system is working for 1000's of users but it should be easily resolved with the help of the properties mentioned above thanks.

Code
Select All
D:\ArduinoIDE\hardware\arduino\avr\platform.txt

# AVR Uploader/Programmers tools
# ------------------------------

tools.avrdude.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude

tools.avrdude.cmd.path.linux={runtime.ide.path}/hardware/tools/avrdude
tools.avrdude.config.path.linux={runtime.ide.path}/hardware/tools/avrdude.conf

tools.avrdude.upload.params.verbose=-v -v -v -v
tools.avrdude.upload.params.quiet=-q -q
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" 



You can change the -C to be whatever you need
« Last Edit: Jul 3rd, 2014 at 12:15pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #4 - Jul 4th, 2014 at 7:37pm
Print Post  
Thanks for your email to say you have changed your config file and it works.

I have looked into the problem because it is such a common and important command that was failing for you.

I found a bug in Visual Micro to do with an old obsolete setting for Arduino 1.0.x versions that should not be used for 1.5.x.

There will be a change to the next release of Visual Micro to prevent this issue.

I think you have a path set in "tools>options>visual micro>toolchain locations>avr". This is for arduino 1.0.x and causes a problem with 1.5 which passes a config file instead of a path to avrdude.exe

If you clear the path in "tools>options>visual micro>toolchain locations>avr" you should be able to use the standard 1.5 config. I know you have a working system but it would be useful if you could try it, no problem if busy.

The setting should then simply be "-C{config.path}"


Thanks
  
Back to top
IP Logged
 
Bulow
Newbies
*
Offline


Posts: 3
Joined: Jul 2nd, 2014
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #5 - Jul 5th, 2014 at 10:01am
Print Post  
I changed back to the original platform.txt and deleted the avr path, and it still works (even after restarting Visual Studio), so you're right! Thanks for your help Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot upload, because visual studio overrides my system wide configuration file.
Reply #6 - Jul 5th, 2014 at 10:02am
Print Post  
Great thanks for testing
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint