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 Upload with Atmel ICE (Read 7753 times)
rml
Junior Member
**
Offline


Posts: 38
Joined: Aug 29th, 2016
Upload with Atmel ICE
Dec 4th, 2016 at 7:17pm
Print Post  
Hello,

Can Visual Micro upload sketches via Atmel SAM ICE ?

The Arduino IDE correctly burns the bootloader on my Feather Mo with the Atmel SAM ICE , but it looks like sketch upload must still be done via USB.
I tried Visual Micro's "Use When Uploading" feature: it uploads correctly, but the code then doesn't seem to work - my guess is that the bootloader gets erased in the process. I am not sure if that is the expected behaviour or if I missed something.

Thanks for your help (and for the December VM release)!

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload with Atmel ICE
Reply #1 - Dec 4th, 2016 at 7:35pm
Print Post  
Hi

Thanks for the message.

Yes, using an external programmer to upload a sketch with any board and either arduino or visual micro will remove the bootloader. 

The bootloader is only responsible for serial upload. So if you burn a bootloader it would be for the sole purpose to use usb upload.

I would expect your uploaded code to to work, regardless of bootloader, as long as the aatmel sam ice programmer definition is correct. 

The standard arduino ide upload facility always attempts serial upload. You have to click the "Upload using programmer" command.

Hope this helps.

Interested to know if the code works after you upload using the ICE via the arduino ide.



  
Back to top
IP Logged
 
rml
Junior Member
**
Offline


Posts: 38
Joined: Aug 29th, 2016
Re: Upload with Atmel ICE
Reply #2 - Dec 4th, 2016 at 8:53pm
Print Post  
Hi Tim,

Indeed I missed the "Upload using programmer" in the Arduino IDE, and it doesn't work there either, so I will try to fix that first before going back to VM.

If you have any hint as to what might be wrong there, please let me know! 
Thanks for your help,

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload with Atmel ICE
Reply #3 - Dec 4th, 2016 at 9:19pm
Print Post  
You should be able to use the verbose output and "show build properties" to find the location of programmers.txt that contains the definition for the programmer.

Once we establish there the definition is we can start to see what settings it uses and where the definition comes from.

The fact you say it buns the bootloader properly so that serial usb upload works suggests there can't be much wrong.

Maybe it's just the code is hanging early. Have you got any serial print messages show the status during setup() loop() to prove it works? Do you still have the usb connected after you upload using programmer? Does you code wait for the serial port?

  
Back to top
IP Logged
 
rml
Junior Member
**
Offline


Posts: 38
Joined: Aug 29th, 2016
Re: Upload with Atmel ICE
Reply #4 - Dec 4th, 2016 at 9:44pm
Print Post  
Thanks Tim - I finally managed to do everything using just the ICE connection and the Arduino IDE:
1/ selecting the "Arduino/Genuino Zero (Programming Port)" (instead of Arduino of Feather with USB port)
2/ hitting the classic "upload" button, and not "Upload Using Programmer" which would brick the board

The equivalent settings in VM give the same results, so all clear on that side.

So as you said there wasn't much wrong, just the default programmer definitions that lead to a somewhat counter-intuitive behaviour!

Best,

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload with Atmel ICE
Reply #5 - Dec 5th, 2016 at 3:25pm
Print Post  
Thanks for the update. The M0 is generally work in progress and some conflicts between arduino.cc, arduino.org and adafruit.

If you get OTA working with the feather please let me know.


  
Back to top
IP Logged
 
rml
Junior Member
**
Offline


Posts: 38
Joined: Aug 29th, 2016
Re: Upload with Atmel ICE
Reply #6 - Dec 5th, 2016 at 11:25pm
Print Post  
Hi Tim,

Now that the uploads works, I am trying to debug with the Atmel SAM ICE in Visual Studio, but I have come across some unexpected error messages.

What I did:
1/ added some lines to platform.txt as per http://www.visualmicro.com/forums/YaBB.pl?num=1478353087/0#0

2/ selected "Microsoft GDB Debugger" in vMicro->Debugger (somehow when I do that no check appears next to the menu line, but it shows in the Output window)

Now when I do Debug->Start Debugging, a window pops up saying "This project is out of date - would you like to build it". If I choose "No" it works fine, but if I choose "Yes", I get the following build errors:

1>------ Build started: Project: Blink, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018: The "VCMessage" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at System.String.Format(IFormatProvider provider, String format, Object[] args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at  messageResourceName, Object[] messageArgs)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Microsoft.Build.CPPTasks.VCMessage.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Host.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Quite similar to an issue reported in another thread, but here with a freshly installed Visual Studio 2015 and the latest VM. If following those errors I accept another pop up's proposal to use the result of a previous build, it hangs and I run into trouble (need to manually kill arm-none-eabi-gdb.exe to erase a temp .elf file and so on).

When doing a Debug->Start Without Debugging, I get the same "project out of date" pop up: choosing to rebuild it leads to the same error messages as above. In any case, the code never gets uploaded to the chip (so different result than doing a "Build and Upload" from the VM toolbar).

So in short: although I can debug my code, there seems to be something weird going on!

Best,

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Upload with Atmel ICE
Reply #7 - Dec 5th, 2016 at 11:37pm
Print Post  
You cant debug in visual studio with the atmel ice. The visual.micro debugger is a serial debugger with ip version on the way. The atmel ice is different. Use atmel studio 7 and visual micro if you want to debug with atmel hardware.


It might be supported in the future in visual micro but WiFi debug is becoming more popular so that's where the focus is. If you have simple tcp and udp example for your board we can look at WiFi debug for vs
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint