Programming Due using ATmel Studio without Arduino IDE

I am using ATmel Studio ASF example to test program Due. I do not want to use VisualMicro wrapper for Arduino IDE.

The (only ONE) example compiles, won't download to Due port and then I get a cryptic error message about missing "connected tool".

Apparently the ASF examples require either hardware of software debugging "tool". The documentation really does not explain what this "tool" is nor how to add it to the Studio. There is an empty pull down box titled "Selected debugger / programmer" under Tool tab.

So far I am unable to post this to ATmel ARM forum, but I got some answers from ATmel AVR forum which I appreciate.

I also found old (2012 ) and now apparently abandoned site which shows running the same example without need for this mysterious "tool".

I am sure I am also missing the programming port assignment for ASF, but got one working for VisualMicro.

I would like to hear from someone who "been there done that". Cheers Vaclav

Hello Vaclav,

So far, I've been able to program Due using AS6 ASF via 2x10 JTAG connector. For that, the 'misterious' tool I've used is SAM-ICE emulator. I also needed ARM-JTAG-20-10 adapter (sold separately).

http://store.atmel.com/PartDetail.aspx?q=p:10500253#tc:description https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-20-10/

This is a not a cheap solution but gives enough debugging capacity for exploring Cortex/SAM3 architecture. However, IMO, Arduino remains as a good (and cheap) platform for application development with Due (CAN, Ethernet, WiFi). Now, I am building a small library for face detection/recognition. By the way, I'm curious about what have you in mind for Due with AS. Regards,

p

Thanks, I should have read your reply before my new post. This "problem" has turned into a "he said she said" rounds on variety of sites. In essence I am heading into morass using Due USB outside USBHost:Task. USBHost is too trivial for what I want to do with SAM native USB port. I am struggling with terminology and my first stumble was lack of "connected tool" reported by AS. After being told that I have a bad attitude ( why don;t you use Arduino IDE instead of AS ? ) I now know the "connected tool" is for SAM3X8E programming port which AS did not bother to explain. My next step is to incorporate SAM-BA which is already burned-in ( which part?) in SAM chip, so I should not have to use external means to access the programming port.

It looks as you went the ICE/JTAG route, which I am trying to avoid for now ($$) .

I just want to download the ASF program to Due port.

As far as using USB I am still planning on "optical recognition of subject(s) ". So it looks as we both have similar apps in works.

My first step is to add Mass Storage Contoller ( MSC ) just to be able to figure out how to do web cam next AKA flash drive which I got to sort of work using USBHopst:Task. But I want to use / need interrupts on USB and I decided not to tinker with USBHost anymore , but to use some of the ATmel ASF samples. Hence I am switching to AS and ASF.

Generally fun, but some of the "helpers" are messing things up and I end up just ignoring them.

I really think it would help if one could use asf.h in Arduino IDE . Cheers Vaclav

Vaclav: I just want to download the ASF program to Due port.

To download your ASF program to Due port, do as follows:

I.e. your program name is MY_EXAMPLE1, COM21 is your programming Due USB or COM60 your native Due USB, copy MY_EXAMPLE1.bin where bossac is located (normally here: ...\Program Files (x86)\Arduino/hardware/tools/)

  1. For Due USB programming port:

bossac.exe -i -d --port=COM21 -U false -e -w -v -b MY_EXAMPLE1.bin -R

  1. For Due USB native port:

bossac.exe -i -d --port=COM60 -U true -e -w -v -b MY_EXAMPLE1.bin -R

In AS61, MY_EXAMPLE1.bin should be located here:

...\Atmel Studio\6.1\MY_EXAMPLE1\MY_EXAMPLE1\Debug\MY_EXAMPLE1.bin

Finally, remember to press erase and reset before the programming.

p

Palliser: To download your ASF program to Due port, do as follows:

I.e. your program name is MY_EXAMPLE1, COM21 is your programming Due USB or COM60 your native Due USB, copy MY_EXAMPLE1.bin where bossac is located (normally here: ...\Program Files (x86)\Arduino/hardware/tools/)

  1. For Due USB programming port:

bossac.exe -i -d --port=COM21 -U false -e -w -v -b MY_EXAMPLE1.bin -R

  1. For Due USB native port:

bossac.exe -i -d --port=COM60 -U true -e -w -v -b MY_EXAMPLE1.bin -R

In AS61, MY_EXAMPLE1.bin should be located here:

...\Atmel Studio\6.1\MY_EXAMPLE1\MY_EXAMPLE1\Debug\MY_EXAMPLE1.bin

Finally, remember to press erase and reset before the programming.

p

I did try to run BOSSAC from Windowze command line but did not get pass Program space Files directory. I thought windows can handle more than 7 by 3 file format using CMD. I have to get back to that.Maybe my XP is on strake , again.

The BOSSA ( windows version ) has an GUI options for reset and erase and that is why I am trying to find how Arduino Due actually runs either one of these bootloaders. The doc on BOSSA covers all command line options, I think erase and reset is there too. I'll check that as soon as I can just connect!

I am getting closer to the solution.

Thanks

PS I cannot press reset nor erase with ease. My "setup" is enclosed in 5 by 5 by 5 top open cube. HA HA I am stuck with software "options" or long toothpicks !

Another option is SAM-BA

http://www.atmel.com/tools/ATMELSAM-BAIN-SYSTEMPROGRAMMER.aspx

It's pretty much the same like BOSSAC using the bin file. Good luck!

p

Short update. It looks as there is for Due modified BOSSA. Now if I can figure out how to install it I'll make some progress.