Error message: "error reading variants path"

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have Atmel Studio 7.0.1417 running on a W10 laptop. I would like to make a project using an existing Arduino sketch that compiles and loads correctly on an Uno.

I am confused about how to take an existing Arduino sketch and make a new project in Atmel Studio. No matter what I try, including "New Arduino Project" from the file menu and vMicro New Arduino Project or Existing Arduino Project, in addition to the IDE not seeming to recognize keywords of the Arduino IDE, I also get this error consistently: "Visual Micro Error reading variants path". I will typically get several instances of this error when trying to bring in the Arduino sketch, or even if I just try to start a new blank project without any code.

 

If I try to build the project, I get not only the error mentioned above, but this in the output area:

 

Compiling 'Sleep_mode_test' for 'Arduino/Genuino Uno'
System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.DirectoryInfo.Init(String path, Boolean checkHost)
   at System.IO.DirectoryInfo..ctor(String path)
   at Visual.Micro.MiroAppAPI.SketchCompiler.CreateFileTimeListXml(String fileType, String sPath, String outputPath)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino._compile(SketchBuilder lsketch, String primaryClassName, Boolean verbose, Boolean isDebug)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino.compile(SketchBuilder lsketch, String primaryClassName, Boolean verbose, Boolean isDebug)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp._CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)

 

I have no idea what all this means or how to correct it.

 

If it will help, here is the entire sketch:

 

#include <avr/interrupt.h>
#include <avr/power.h>
#include <avr/sleep.h>
#include <avr/io.h>
int wakePin = 2;                 // pin used for waking up
int led=13;

void wakeUpNow() {
    // execute code here after wake-up before returning to the loop() function
    // timers and code using timers (serial.print and more...) will not work here.
    // we don't really need to execute any special functions here, since we
    // just want the thing to wake up
}

void setup() {
    pinMode(wakePin, INPUT_PULLUP);
    pinMode(led, OUTPUT);
    attachInterrupt(0, wakeUpNow, LOW); // use interrupt 0 (pin 2) and run function wakeUpNow when pin 2 gets LOW
    Serial.begin(9600);
}

void sleepNow() {
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);   // sleep mode is set here
    sleep_enable();          // enables the sleep bit in the mcucr register
    attachInterrupt(0,wakeUpNow, LOW); // use interrupt 0 (pin 2) and run function
    sleep_mode();            // here the device is actually put to sleep!!
    // THE PROGRAM CONTINUES FROM HERE AFTER WAKING UP
    sleep_disable();         // first thing after waking from sleep: disable sleep...
    detachInterrupt(0);      // disables interrupt 0 on pin 2 so the wakeUpNow code will not be executed during normal running time.
    Serial.println("I'm awake!");
}

void loop() {
    digitalWrite(led, HIGH);
    delay(1000);
    digitalWrite(led, LOW);
    sleepNow();     // sleep function called here
}

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like a question for the Visual Micro forum..., or did you want to used the importer from studio (that converts the sketch to a C++) program?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Sounds like a question for the Visual Micro forum..., or did you want to used the importer from studio (that converts the sketch to a C++) program?

It doesn't matter how I bring it in - I get the same result. I had thought that by now, the process of importing an Arduino sketch into AS7 would be pretty foolproof, obviously it isn't.

I just am not sure what to do now. I'm not a high-end coder, and the error messages are meaningless to me.

I can certainly try the VM forum and see what happens...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, if you use the one in Atmel Studio, it should work without problems (file, new project, create from Arduino).

Can't really speak for the Visual Micro one, as I haven't used that plugin...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Well, if you use the one in Atmel Studio, it should work without problems (file, new project, create from Arduino). Can't really speak for the Visual Micro one, as I haven't used that plugin...

meolson, that is what I did - same result no matter what.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But, then you should have another error than the one you showed... The error with Visual Micro is from the Visual Micro plugin. 

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Well, if you use the one in Atmel Studio, it should work without problems (file, new project, create from Arduino). Can't really speak for the Visual Micro one, as I haven't used that plugin...

OOPS! I stand corrected - what I did was File/New/Arduino project, then followed the prompts for sketch location, etc. Same errors.

HOWEVER - when I did File/New/Project/Create project from Arduino sketch, that seemed to work after several AS7 re-starts. For some reason, when you get to the prompt where it's asking for the sketch you want to import, and you click the little "browse" button (the small square with 3 dots inside it) AS7 crashes. You can enter the path to the sketch manually, but you can't use the browse feature to select one.

Anyhow, once I got past that, I was able to import the sketch and it built with no errors.

So, why don't the other "make a project from Arduino" options seem to work? What is the difference between the three of them?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The one that worked (eventually) is built into studio. It converts the sketch into a complete C++ project with all the arduino nuts and bolts visible (one way, you cannot easily go back to a sketch). The others are from the Visual Micro plugin, which allows you to work on sketches in Studio (and provides its own debug implementation etc).

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
The one that worked (eventually) is built into studio. It converts the sketch into a complete C++ project with all the arduino nuts and bolts visible (one way, you cannot easily go back to a sketch). The others are from the Visual Micro plugin, which allows you to work on sketches in Studio (and provides its own debug implementation etc).

At the risk of sounding dull-witted, I fail to see how the Visual Micro-based options have any value, since they don't seem to work with Arduino code at all. I would freely admit that ignorance is likely why I don't "get it", but a total failure using Arduino code that runs without problems in the Arduino IDE (and, in fact, runs fine in the AS7 importation) seems to indicate a serious flaw in the VM options.

At any rate, I'm up and running, and as soon as I figure out how to change the timer/delay functions to use 8 MHz instead of 16 MHz, things will be wonderful!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

davetelling wrote:
I fail to see how the Visual Micro-based options have any value, since they don't seem to work with Arduino code at all.
This is historical. First there was no Arduino support in AS6 at all. Then "Visual Micro" saw an opportunity to make some money so they developed an "extension" that adds some Arduino support including their own soft monitor/debugger thing. They manage to irritate a lot of people by making it "nag-ware". Presumably in parallel (I don't think they did it just in reaction) Atmel themselves worked on an "Arduino import" mechanism. That was one of the "big features" when AS6 turned in to AS7. For all intents and purposes it completely blows Visual Micro out of the water because now Studio itself has the ability to import Arduino INO sketches (presumably to gain access to the better editor and debugging using Atmel debugging hardware).

 

So if you have AS7 what on earth even made you consider installing Visual Micro when AS7 can natively "do" Arduino anyway ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

davetelling wrote:

I fail to see how the Visual Micro-based options have any value, 

As clawson explained: with AS7, they don't.

 

clawson wrote:
 if you have AS7 what on earth even made you consider installing Visual Micro 

 

Probably saw an old video or tutorial showing how to do it with AS6 + VM (maybe it didn't even specify AS6 - just "AS"), and just didn't realise that AS7 does it all itself - so VM is redundant.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why, I wonder, is VM even offered in the Extension Gallery (AS7) anyway? Just there to confuse people!