Pages: [1]   Go Down
Author Topic: Uploading with Atmel Studio 6  (Read 5069 times)
0 Members and 2 Guests are viewing this topic.
Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 752
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Be The Change...

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 522
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 615
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 752
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Be The Change...

Odense, Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: July 31, 2014, 11:37:46 am by grumson » Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 615
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks!

It's working now!
Logged

Pages: [1]   Go Up
Jump to: