Atmel Studio 7 cannot browse to find Arduino source.

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

I have recently downloaded Atmel Studio 7 and have been trying to use it to improve on an Arduino sketch I have been toying with. As per the tutorials out there, I clicked New Project > Create project from Arduino sketch>OK, and a form appears to set the source file and Arduino paths. The Arduino path browse button (...) works fine, but the Sketch file browse button, when pressed, returns a message box showing 'The system cannot find the drive specified'. If I close this and try again, Studio 7 shuts down, and then restarts. Any ideas why I cannot browse to a file on this m/c. Interestingly, I have tried it on another PC, running the same OS (W10) and the problem is not there - all works OK. Admin mode doesn't help. Could this be an Explorer problem/setting ?

Last Edited: Thu. Jan 3, 2019 - 11:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you able to build that sketch in Arduino IDE?

 

Regards,

Charles

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

Hi Charles

Yes I am able to build it, but at this stage, AS7 doesn't know what 'that sketch' is. I have only got as far as saying I want to create a project from an Arduino sketch, and it is at the stage, where I should be browsing for the sketch, that it fails.

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

Which version of Arduino IDE and Atmel Studio do you have installed in the machine? 

 

Could you check whether %localappdata%\Arduino15\preferences.txt is available in your machine ?

 

I would recommend you to use the latest Atmel Studio version 7.0.1931.

 

1) Start with a Blink.ino file in Arduino verify it from Arduino IDE

2) Start Atmel Studio and see whether it populates automatically with the latest sketch used in Arduino IDE

 

Regards,

Charles

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

Hi Charla

Arduino IDE is version 1.8.5, Atmel Studio is 7.0.1931

Blink.ino verifies OK and also uploads and runs fine.

When I start Atmel Studio, and choose New Project > Create project from Arduino sketch > OK, the sketch file field is blank and the browse button shows the message I described above.

Thank you for your interest

Graham

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

Oh, and I can see preferences.txt

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

Could you share the file %localappdata%\Arduino15\preferences.txt  ?

 

Regards,

Charles

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

As a workaround could you paste the sketch file path in  C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino instead of browsing.

 

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

Hi Charles

If I paste the file location it works fine, but I cannot browse to it. Preferences file attached.

Thanks

Graham

Attachment(s): 

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

I am having this same problem as Monitair.

 

I just loaded Atmel Studio 7.0.1931 and have Arduino IDE 1.8.5 and when going to load the sketch file (find it with the browser button)  I get the error "The system cannot find the drive specified". I then cancel the dialog and Atmel Studio crashes.  My arduino ID is located at: C:\Program Files (x86)\Arduino.  I did install Atmel Studio as Administrator. As Monitair suggested if you cut and paste path into sketch location box all works, but this is not an acceptable work around.  

 

Does anyone know why this is occurring? Is the error message bad syntax and that it is a permissions thing etc.

 

 

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

I'm guessing it's not the Arduino IDE location throwing the error but the default choice for "Sketch file".

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

@Clawson,

 

 ...but the default choice for "Sketch file".

 

What you need to understand is that when this happens to me, I don't even get the choice; i.e. when I click on the "..." browse button, it throws this error. Unless you are saying that my default installation is defaulting the sketch location to a bad location?  Is there a way to create an error log when this happens to see in more detail what the issue is?

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

AS7.0 has let me Browse for the sketch ok.

It started with the previous directory I had used in a different AS7 project.

 

I suggest that you "Open" any file on your C drive.   Then it will probably start Browsing from that directory.

 

It found the correct directory for my v1.8.8 installation.

It found that my current project was for a MEGA2560

It did not assume ATmega2560.   I had to choose 1280 or 2560.

 

AS7.0 is ok for importing very simple sketches for Uno, Mega.

 

It is crap for Zero, Due, ...

It is crap for multi-file sketches.  

It is crap for functions with pointer arguments.

 

David.

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

david.prentice wrote:
It is crap for Zero, Due, ...
though not zero price :

Developing code for ARM-based Arduino boards with Visual Studio – VisualGDB Tutorials

...

In this tutorial we will create a basic “Blinking LED” project for the Arduino Due board and will show how to FLASH it using the built-in bootloader and debug it using Segger J-Link.

...

 

"Dare to be naïve." - Buckminster Fuller

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

One thing you could try is ProcMon from sysinternals. Set a filter on atmelstudio.exe and CreateFile and you will be able to see what directory/files it's trying to access. When I do that on my machine here and open the Create C++ project from Arduino sketch dialog I see this activity...

 

 

I'm guessing you may see something "odd" here.

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

Some years ago Visual Studio Micro created an add-on to AS5 or AS6.    It worked well.

If you installed it you were subjected to Spam for evermore.    I don't think it was possible to Uninstall it.

 

I have no problem with purchasing software,  buying licences,   ...

 

If there is a VS VisualMicro User that can make a personal recommendation,   I would be happy to try VS VM.

Without such assurance I will not touch it with a bargepole.

 

Meanwhile,   I will continue to build in the Arduino IDE.   Debug the "Externally Built Executable" in Rowley Crossworks.     Which works fine with STM32, Zero, Due, ...

 

David. 

 

Edit.   I had mistakenly assumed Visual Studio was the same as Visual Micro.    It is a different product.

Last Edited: Mon. Mar 18, 2019 - 04:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi David,

 

I have already tried what you suggested and it does not work or help my issue. - i.e. I entered a direct path - something like C:\temp\blink-test\Blink-test.ino and Studio will accept this sketch and build it, but if I try to click the browse button to the right of this input Box for the sketch, even after I enter the direct path I still get the error dialog and the crash of Studio.

 

Mark

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

Thank you Clawson,

 

One thing you could try is ProcMon from sysinternals.

 

I will try this tonight when I get home.  Gotta go earn a living right now... :-)d

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

What happens with regular AS7 "Open Project" or "Open C file" ?

Does this Browse correctly.

 

I suspect that you have been using an imaginary Drive somewhere.    Browse "starts" at the imaginary location and crashes when it does not exist (instead of flagging an error).

 

David.

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

david.prentice wrote:
Some years ago Visual Studio created an add-on to AS5 or AS6.
Visual Micro?

Arduino IDE for Visual Studio

alternate path : Arduino IDE for Visual Studio - Visual Studio Marketplace

 

The ones at Microsoft, along with other ones, created an Arduino extension for Microsoft Visual Studio Code :

https://www.avrfreaks.net/forum/avr-studio-mac-linux#comment-2440271

 

"Dare to be naïve." - Buckminster Fuller

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

Oops.   Yes,  I meant Visual Micro.

 

So Visual Studio is a different product.

My apologies.   I will edit my previous message.

 

David.

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

"imaginary drive" can often mean a network share that is later disconnected.

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

Here is a snipet from a file that was written by microsoft  and put in my app-data/local directory when the crash occurred:

 

LoadedModule[202]=C:\WINDOWS\SYSTEM32\MPR.dll
LoadedModule[203]=C:\WINDOWS\System32\drprov.dll
LoadedModule[204]=C:\WINDOWS\System32\ntlanman.dll
LoadedModule[205]=C:\WINDOWS\System32\davclnt.dll
LoadedModule[206]=C:\WINDOWS\System32\DAVHLPR.dll
LoadedModule[207]=C:\WINDOWS\System32\wkscli.dll
LoadedModule[208]=C:\WINDOWS\SYSTEM32\cscapi.dll
LoadedModule[209]=C:\WINDOWS\System32\netutils.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
File[0].CabName=WERInternalMetadata.xml
File[0].Path=WER5686.tmp.WERInternalMetadata.xml
File[0].Flags=851971
File[0].Type=5
File[0].Original.Path=C:\Users\mbiasotti\AppData\Local\Temp\WER5686.tmp.WERInternalMetadata.xml
File[1].CabName=triagedump.dmp
File[1].Path=WER62AE.tmp.dmp
File[1].Flags=539820035
File[1].Type=6
File[1].Original.Path=C:\Users\mbiasotti\AppData\Local\Temp\WER62AE.tmp.dmp
File[2].CabName=WERDataCollectionFailure.txt
File[2].Path=WER6791.tmp.WERDataCollectionFailure.txt
File[2].Flags=851971
File[2].Type=5
File[2].Original.Path=C:\Users\mbiasotti\AppData\Local\Temp\WER6791.tmp.WERDataCollectionFailure.txt
File[3].CabName=Report.cab
File[3].Path=Report.cab
File[3].Flags=196608
File[3].Type=10
File[3].Original.Path=Report.cab
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=Atmel Studio 7.0
AppPath=C:\Program Files (x86)\Atmel\Studio\7.0\AtmelStudio.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=C8011494DCE04A8A99E6BE2B1AC19541
 

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

I finally solved this - or rather Bob Martin solved this for me (who's class I attended this last Saturday at Microchip - Arduino Celebration day: it was excellent) Here's what he wrote back to me:

 

This is a known and very strange issue with a simple fix

 

The problem exists within the preferences.txt configuration file used by the Arduino IDE

 

In the Arduino IDE ,under File à Preferences towards the bottom of the dialog window will be the explicit path to this file which you can click on to open up the specific location in File Explorer.  Open this file in any text editor and you will see references to

 

last.sketch0 à last.sketch4

 

last.sketch.default.path  and

 

recent.sketches=

 

with possibly a long list of explicit paths to all the sketches that have been opened

 

Somewhere in these lines, is a path, usually to a network drive, that isn’t valid at the time you are trying to import via Atmel Studio.

This is why Atmel Studio is blowing up since it’s trying to parse an invalid path specified in that file.  Technically you can wipe the recent.sketches paths and just leave

recent.sketches=

 

Save a copy of the preferences.txt as backup and then start looking for paths that are not currently valid, again network drives that are not actively mounted or external USB drives that are not available. That’s where the problem is.

 

cheers

bob m

 

Thank you Bob for the quick response and fix. I have verified that it is, in fact, the problem and now Studio 7 - loading Arduino Sketch location works.

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

Thanks Bob for your response and also mbiasotti. This solved my problem.