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
Hot Topic (More than 8 Replies) Device programming through VM+AS6.2 (Read 11159 times)
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Device programming through VM+AS6.2
Apr 16th, 2014 at 6:25pm
Print Post  
For the majority of my projects, I write, compile, and upload through a USB connected Arduino (clone). however, every so often I need to program a raw device that doesn't have USB on it. So instead I use the ICSP pins to do that. Normally I do that by writing code in the Arduino IDE, compile it, then I will open the AS Device Programming window, load up the HEX file generated, and program the device that way.

A few days ago I discovered that if I write my code in AS+VM and hit the Build (selected or solution) button in AS, and then click on Device Programming, in the Memories tab, it already has the elf file filled in for that sketch I just compiled. So I thought I could hit program right then and there ... and that's when the problems started: it doesn't work.

What happens is, the device gets programmed just fine, but WHAT it's programmed with I don't know. Even if I change the selected .elf file for the .hex counter part, it's still not working. I tried a simple turn LED 13 on and off and I get nothing.

To reiterate:
In the Arduino IDE, I can write my code and compile it to create the needed elf or hex file.
In AS, I can open Device Programming, select the generated hex file and program the raw device, no problem.

If I do the same within AS+VM, I can build it to create the necessary elf and hex files, open Device Programming where the elf file is already selected for me and upload - however whatever it's uploading isn't working. Same thing if I change it to use the hex file instead.

Am I doing something wrong here? I've made sure I have the proper device selected, the proper IDE version being used, fuses and lock bits are set right ... I don't know what else to look for.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #1 - Apr 16th, 2014 at 6:33pm
Print Post  
Hi,

Thanks for the post. Copying the .elf to the debug folder is a new feature and a bug means the .elf is always from the previous build. It will be fixed in a week or two

If you switch on "show build folder" you will see the location of the "real" .elf in the output window after compile. It will always be the same for each project this document shows the options http://www.visualmicro.com/page/User-Guide.aspx?doc=Tools-Options-Reference.html

AS6 has a bug, it does not save output folder change when you close the project so double annoying.

Out of interest are your device programming settings common to other users? Maybe they can be added to "Tools>Visual Micro>Programmers"
  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #2 - Apr 16th, 2014 at 6:44pm
Print Post  
Ah, that would certainly explain why it was working the first time but subsequent uploads would fail horribly. I'll turn on 'show build folder' and monitor that.

Tim@Visual Micro wrote on Apr 16th, 2014 at 6:33pm:
Out of interest are your device programming settings common to other users? Maybe they can be added to "Tools>Visual Micro>Programmers" 

So about 75% of the time, I'm simply uploading through devices that have a bootloader with USB capability on them, like many Arduinos do. The other 25% of the time is when I'm working on devices I've designed/build myself OR when I don't care for the bootloader and just put the sketch on the device. For those I have an Atmel mkII.

When I go in Device Programming, I will set the fuses and lockbits the way I need them for that specific device and then upload the code right there. I haven't considered trying VM's Programmers option - will that give me the same functionality?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #3 - Apr 16th, 2014 at 7:44pm
Print Post  
In the last release of visual micro we provide new atmel programming options which use the atmel usb drivers

Put a tick in "tools>visual micro>programmers>atmel avrisp mkII"
and tick "tools>visual micro>upload using programmer"

Now you can simply use F5 or CTRL+F5 to upload debug/release. If you do not want debug very often then untick "tools>visual micro>automatic debugging" and F5 will upload a normal Release compilation.

So it does not sound like you need to use the atmel studio device programming, Visual Micro does an automatic upload and this is not using the bootloader.

See here for Tools Menu overview http://www.visualmicro.com/page/User-Guide.aspx?doc=Tools-Menu.html
  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #4 - Apr 16th, 2014 at 7:47pm
Print Post  
Ok, I will try that this evening and will report back. However it brings me back to the previous issue: will enabling the programmer this way (and thus NOT use AS' device Programming option), will that upload the correct elf/hex file then?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #5 - Apr 16th, 2014 at 7:48pm
Print Post  
Yep
  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #6 - Apr 16th, 2014 at 8:04pm
Print Post  
Awesome. Thanks for the guidance. I will try switching the setup this evening and see how that goes.

I did notice a second build happening elsewhere when I was trying to figure out what was going on (using the Device Programming in AS). The one that Device Programming was listing resides inside of the Debug folder of the project folder. The second one was happening inside of my profile's AppData path, specifically:

%USER%/AppData/Local/VMicro/Arduino/Builds/<project>/micro/

I didn't test those elf/hex files ... I think at that point in the evening I was too tired to keep going, not to mention a bit frustrated. I had already switched back to the stand along Arduino IDE->compile->AS Device Programming to get the code "out the door" so to speak. Now that I have more time, I can see about those files and how they compare with what's in the project folder ...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #7 - Apr 16th, 2014 at 8:34pm
Print Post  
Those hex files in the real temp folder are the actual files and are always correct. 

You don't need to worry about hex files, if you use the proper visual micro features then it is all correct. Only when you use manual atmel tools can there be confusion.

Thanks
  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #8 - Apr 16th, 2014 at 8:40pm
Print Post  
Yeah I figured those would be correct. It's similar to what the Arduino IDE does, except it dumps it in the %TEMP% folder instead. So it seems when VM passes information to the AS Device Programming window, that information isn't right (assuming it's VM passing information and not AS pulling it out of thin air.) Why is there a Debug version created inside of the project folder anyway? Is that AS doing it?
  
Back to top
 
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #9 - Apr 17th, 2014 at 12:09am
Print Post  
Ok something's not working:

Tools -> Visual Micro -> Programmers -> AVRISP mkII
Tools -> Visual Micro -> Upload using Programmer

When I try to upload, VM complains:

Code
Select All
Compiling 'Test' for 'SparkFun Pro Micro 5V/16MHz'
Build folder: /promicro16
Binary sketch size: 7,702 bytes (used 27% of a 28,672 byte maximum) (0.45 secs)
Uploading to I/O board using 'AVRISP mkII'
avrdude: usbdev_open(): did not find any USB device "usb" 



Now I can open AS' built-in Device Programming and program the device just fine, so obviously the mkII is working and recognized by the system itself (and by AS), just not through VM.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #10 - Apr 17th, 2014 at 12:15pm
Print Post  
Hi there,

This error is expected if you used the standard arduino avrispmkII programmer menu item because it uses Arduino usb and not Atmel usb.

Do you see programmers at the end of the menu that start with the word "Atmel"? 

Tools>Visual Micro>Programmers>Atmel AVRISP mkii?

ps: Atmel creates the debug/release folders automatically, vm has no control over that so this is why we have started to use it.
« Last Edit: Apr 17th, 2014 at 4:49pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #11 - Apr 17th, 2014 at 10:48pm
Print Post  
Negative, I do not have an Atmel specific listing:

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #12 - Apr 17th, 2014 at 11:51pm
Print Post  
Oh, yes sorry they only show to 1.5 avr boards. If you can get a 1.5 definition/config for your board then the programmers will show.

  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #13 - Apr 17th, 2014 at 11:55pm
Print Post  
Uh, bwuh? What do you mean 1.5 avr boards? - never mind, I figured it out.
« Last Edit: Apr 17th, 2014 at 11:56pm by KirAsh4 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Device programming through VM+AS6.2
Reply #14 - Apr 18th, 2014 at 12:01am
Print Post  
Yes the board will run fine under 1.5 just needs a couple of different config files and install into slightly different location.

Libraries and code are the same.
  
Back to top
WWW  
IP Logged
 
KirAsh4
Junior Member
**
Offline


Posts: 10
Joined: Apr 3rd, 2014
Re: Device programming through VM+AS6.2
Reply #15 - Apr 18th, 2014 at 12:15am
Print Post  
Yeah, I'll have to either a) restructure SFE's core files and locations or b) use a different bootloader (like Leonardo.) I'll figure out what to do from here.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint