Go Down

Topic: Uploading with Atmel Studio 6 (Read 5888 times) previous topic - next topic

pingflip

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

pracas

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.. 
Be The Change...

pingflip

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

Palliser

Quote
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.

hiduino

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.


pracas

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..
Be The Change...

cvrtky

Quote

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.

Transistorfips

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?

grumson

#8
Jul 31, 2014, 06:19 pm Last Edit: Jul 31, 2014, 06:37 pm by grumson Reason: 1
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!

hiduino


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.

Code: [Select]

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


Go Up