Uploading with Atmel Studio 6

Hi,

How do I upload code written with Atmel Studio 6?
Do I need a SAMIce Debugger/Programmer or is there a way to upload via the usb programming port?

Cheers

Pingflip

The following 2 commands will help you upload a .bin file from command line using the programming port

mode com7:1200,n,8,1

bossac.exe --port=COM7 -U false -e -w -v -b Blink.cpp.bin -R

you need to add the location of the bossac.exe (somewhere inside the arduino folder) to your path file

if you want this to work from Atmel Studio, You can create a batch file and create an external tools under the tools option in Atmel Studio like this
http://www.jayconsystems.com/tutorial/atmerpt1/

Let me know how it goes..

Hi,

thanks for the answer, i'm gonna try that tomorrow.
I just did a quick test with bossac gui and tried to connect to the board, but it was not able to connect (tried on Os X, Windows 8, and Win XP running in a virtual Box on a mac).

Pingflip

bossac.exe --port=COM7 -U false -e -w -v -b Blink.cpp.bin -R

you need to add the location of the bossac.exe (somewhere inside the arduino folder) to your path file

Every time I need to re-load a sketch in the Arduino Due using bossac as you mentioned, I have to erase-reset the board. Why?
I don't know yet. That is not happening with Arduino IDE. I have checked this phenomenon with Windows 7 and Windows XP with same results.
May be Arduino IDE shows in the verbose output, just part of the enumeration of the upload.

Yes, the bossac bootloader only runs if the memory is erased. The Arduino IDE does this by opening and closing the COM port at 1200 baud. This causes the Due to execute a soft erase command.

ok..I think to use bossac gui, you need to press the erase button before you choose to load your program but the batch file would be a better approach for loading from within atmel studio. I have no clue how to program the SAM3X8E in atmel studio otherwise i would try.. perhaps you can share a simple code..

The following 2 commands will help you upload a .bin file from command line using the programming port

mode com7:1200,n,8,1

bossac.exe --port=COM7 -U false -e -w -v -b Blink.cpp.bin -R

On win7 the solution, that made it work for me, was to add ",p" to the end of the mode line ie. (using com6) :
mode com6:1200,n,8,1,p instead of just mode com6:1200,n,8,1

Now mode com outputs the following :

Status for device COM6:

Baud: 1200
Parity: None
Data Bits: 8
Stop Bits: 1
Timeout: ON
XON/XOFF: OFF
CTS handshaking: ON
DSR handshaking: ON
DSR sensitivity: OFF
DTR circuit: HANDSHAKE
RTS circuit: HANDSHAKE

Instead of :

Status for device COM6:

Baud: 1200
Parity: None
Data Bits: 8
Stop Bits: 1
Timeout: ON
XON/XOFF: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: ON

And bossac is uploading w.o. any pressing of the Erase button.

Hi, I found this engblaze project (probably everyone knows it) using the arduino standard programmer for the 8bit machines wit AVR-Studio5 and 6. Is there a chance to adapt the code for the 16U2 to the Due to run it with avrdude or bossa so it will work out of the IDE without a additional command line thing?

Hi!

I have problem to load program to board with Atmel studio!

I write this to Batch file:

mode %1:1200,n,8,1,p

C:\Program Files (x86)\Arduino\hardware\tools\bossac.exe --port=%1 -U false -e -w -v -b %2 -R

and when I want to load program to board I get this error:

C:\Program Files (x86)\Atmel\Atmel Studio 6.2>mode COM37:1200,n,8,1,p

Status for device COM37:

Baud: 1200
Parity: None
Data Bits: 8
Stop Bits: 1
Timeout: OFF
XON/XOFF: OFF
CTS handshaking: ON
DSR handshaking: ON
DSR sensitivity: OFF
DTR circuit: HANDSHAKE
RTS circuit: HANDSHAKE

C:\Program Files (x86)\Atmel\Atmel Studio 6.2>C:\Program Files (x86)\Arduino\hardware\tools\bossac.exe --port=COM37 -U false -e -w -v -b "C:\EMBEDDED PROGRAMMING\AtmegaAVR\AtmelStudio\DUO\ARDUINO_DUO_Led_13\Release\ARDUINO_DUO_Led_13.bin" -R
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

can someone please tell me what I did wrong!
Thanks!

grumson:
C:\Program Files (x86)\Atmel\Atmel Studio 6.2>C:\Program Files (x86)\Arduino\hardware\tools\bossac.exe --port=COM37 -U false -e -w -v -b "C:\EMBEDDED PROGRAMMING\AtmegaAVR\AtmelStudio\DUO\ARDUINO_DUO_Led_13\Release\ARDUINO_DUO_Led_13.bin" -R
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

You need to escape the spaces in the directory names and file names. Try adding quotes around the names with spaces.

C:\Program Files (x86)\Atmel\Atmel Studio 6.2>C:\"Program Files (x86)"\Arduino\hardware\tools\bossac.exe --port=COM37 -U false -e -w -v -b "C:\EMBEDDED PROGRAMMING\AtmegaAVR\AtmelStudio\DUO\ARDUINO_DUO_Led_13\Release\ARDUINO_DUO_Led_13.bin" -R

Thanks!

It's working now!

I am new to Atmel Studio and trying to get some code uploaded to an Arduino Due. I'm having no luck getting it to act like the Arduino IDE. My board shows up as COM5 normally and COM11 when in program mode. I appear to get a successful write in Atmel Studio but it always stays COM11 instead of going back to COM5. Which COM port should be used in this batch file?

Try Atmel studio 7 for Arduino builds:

http://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx