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 Atmel Studio SAM Project Guidance (Read 12249 times)
awordforthat
Newbies
*
Offline


Posts: 3
Joined: Oct 3rd, 2014
Atmel Studio SAM Project Guidance
Oct 3rd, 2014 at 10:11pm
Print Post  
I wasn't sure whether to post this here or in this threadhttp://www.visualmicro.com/forums/YaBB.pl?num=1410880645/0#0, but hopefully someone will move it if it's in the wrong place.

I tried to create an Arduino project by opening a new CPP project. I selected my SAM chip and chose my programmer/debugger (JTAG SAM-ICE). Then I manually added a .ino file named [MyProject].ino. This gives me a popup that says "Content of CMSIS folder will be removed and updated for new device. Continue?" I said "Yes" to that - so far so good. 

Now if I close Atmel and reopen it, the project fails to load with the error message
Code
Select All
An error occurred trying to load the page.
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) 

. I can build at this point, but the chip setting has reverted to ATmega2560, and I can't select the JTAG debugger at all - it's not even an option. 

Any suggestions on how to get the programmer/debugger settings to stick? 

Thanks!

« Last Edit: Oct 4th, 2014 at 2:12pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Atmel Studio SAM Project Guidance
Reply #1 - Oct 4th, 2014 at 2:16pm
Print Post  
Hi,

Thanks for the post. It is often best to create a new thread because questions and reasons for questions differ so much.

There are a number of different conversations/questions that might arise from your post so it would first help to understand what you are trying to achieve.

Are you trying to build an Arduino compatible project but to upload using non-arduino programmer options?

Are you trying to debug Arduino using Atmel Studio debug or Visual Micro debug?

Did you try using Visual Micro to create your project? If so what was the problem with that?

Did you use review the Visual Micro/Arduino programmers and find they do not do what you need?

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Atmel Studio SAM Project Guidance
Reply #2 - Oct 4th, 2014 at 8:28pm
Print Post  
more ...

I re-tested switching between 8 bit and 32 bit boards in Atmel Studio and as you have observed it wasn't working very well.

There is a new sp5 release that fixes things so you can use a clean arm g++ project or use the new file>new>project>arduino 32bit project" options.

In all cases it should work better now but more importantly if you have a 32 bit project then it will show the correct devices.

My questions below still stand because it might be that you do not need the atmel devices but in any event the sp5 version will be much better

Thanks again for the report

http://www.visualmicro.com/forums/YaBB.pl?board=NEW_RELEASES;action=modify;messa...
  
Back to top
WWW  
IP Logged
 
awordforthat
Newbies
*
Offline


Posts: 3
Joined: Oct 3rd, 2014
Re: Atmel Studio SAM Project Guidance
Reply #3 - Oct 6th, 2014 at 5:03pm
Print Post  
Hi Tim,

Thanks for the quick reply. Here's a summary of where I am and what I'm trying to do:

I have a Due that I'm trying to program and debug. I've been using VM for both (and it's great! Very impressive work). There are two things that I'm trying to get around: the slow serial upload speed and certain debugging features that VM doesn't seem to offer (yet?). 

To avoid serial uploads, I've been trying to use the Atmel SAM-ICE over JTAG. SP5 seems to have fixed the corrupted-project problem from my last post - thanks! I still get an error on upload:
Code
Select All
Uploader started for board Arduino Due (Programming Port)
Uploader sometimes uses programmer name: atprogram_atmelice_isp
Uploader will attempt to use programmer name: atprogram_atmelice_isp
C:\Program Files (x86)\Atmel\Atmel Studio 6.2\atbackend\atprogram -d cortex-m3 -v -t atmelice -i ISP program -c -f duino_due_x_dbg\GccApplication2.hex"
Error during upload using programmer
[DEBUG] Starting execution of "program"
[DEBUG] Starting process 'C:\Program Files (x86)\Atmel\Atmel Studio 6.2\atbackend\atbackend.exe'
[DEBUG] Connecting to TCP:127.0.0.1:59405
[INFO] Could not find tool. Retrying...
[INFO] Could not find tool. Retrying...
[INFO] Could not find tool. Retrying...
[INFO] Could not find tool. Retrying...
[INFO] Could not find tool. Retrying...
[ERROR] Could not find tool.

The uploader returned an error 


I haven't spent a lot of time trying to research or fix this. Just reporting back on the new SP5.

Separately, there are debugging options that would be really nice to have in VM - namely, the ability to hover over variables during runtime and see their contents, and the ability to dynamically set/adjust/delete breakpoints without reuploading the whole project. 

If I could solve either one of these problems, I'd be really happy, and if I could solve both, even better. I'm not worried about backwards compatibility with the native Arduino IDE - dunno if that helps at all. 

I'm pretty new to all of this, so please let me know if I'm headed down the wrong path here. 

Thanks for all your help!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Atmel Studio SAM Project Guidance
Reply #4 - Oct 6th, 2014 at 6:35pm
Print Post  
Hi,

The error you see is an atmel studio internal error. When we call the atmel upload command it uses a local tcpip connection to call its main tool. 

We could see this problem when we first added support for atmel (non-arduino) programmers and resolved it by forcing the path to include the atmel studio tools location. I would need to look into why it's happening with the sam-ice but won;t be able to do that for a while.

You can use atmel studio "device programming" option instead.

For debug you need to click "file>open>object file for debugging". This will give you a new atmel project that should be able to debug using atmel features.
  
Back to top
WWW  
IP Logged
 
awordforthat
Newbies
*
Offline


Posts: 3
Joined: Oct 3rd, 2014
Re: Atmel Studio SAM Project Guidance
Reply #5 - Oct 7th, 2014 at 3:16pm
Print Post  
Which path do you mean? Windows, something inside Atmel? Is that something I could do myself, or is that internal to Visual Micro?

And just to clarify - currently there is no way to use Visual Micro for arduino integration/debugging, but use the SAM-ICE for uploading, correct?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Atmel Studio SAM Project Guidance
Reply #6 - Oct 7th, 2014 at 3:24pm
Print Post  
Hi,

Sorry I was in a rush yesterday.

The visual micro debugger uses serial so can not run via any hardware programmer. 

Visual micro injects debugger serial commands into a copy of the sketch code prior to compile. It is designed as a replacement to hacking arduino code with serial.print and serial.read commands which is normally the only way to debug arduino.

In the not to distant future the debugger will be updated to allow you to dynamically name variables/expressions to watch or update, this will not require re-compile however setting breakpoints always will require re-compile.

The only reason to use a hardware programmer with Arduino would be to upload a little faster than usb upload.

The path issue is not something you can easily solve. However if you add the upload command to a .bat file and run it from outside atmel studio it will probably work. The issue is an internal atmel studio issue that causes the problem when running from inside their ide but not using their dlls. Something to do with the environment path they apply to all processes that run from within atmel studio. If I recall we had to alter out code to zap their paths but I would expect that still to be working.

having said this I thought I read about a native arduino solution for the sam programmer in 1.5.7/8. If this is available then the arduino version of the programmer will appear in the vm menus and should work (the name will not start with the word atmel)

I hope this clarifies things but not what you need

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint