Pages: [1]   Go Down
Author Topic: Programming from command line using the "Programming port"  (Read 1193 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have searched the forum for this issue but didn't find the answer.

I can upload sketches using the arduino IDE from the programming port. I can also upload programs I write in Atmel Studio 6 directly to the SAM3X via the native port using BOSSA with the following command:

Code:
bossac -p COM5 -i -e -w -v -b D:\file.bin -R

This all works fine, however, I would like to upload code to the SAM3X using the "programming port" from a command line (not using the arduino IDE).


Does anyone know a good way to do this, or how this can be done? Any assistance or insight will be much appreciated.

Best Regards,
Michael

 
Logged

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

Be curious, too.
Some suggestion here. For enabling the bootloader, you may open the programming serial port and set it baudrate 1200bps first. Then try to use bossac to upload the DUE.

Sorry for my poor English.
« Last Edit: January 15, 2013, 08:54:05 am by gaplee » Logged

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

Hello gaplee

Thanks for your reply. I have been looking at the arduino IDE source code to understand how the arduino IDE programs the SAM3X thru the virtual serial driver.

The arduino programming port driver is a virtual serial driver which is a modified version of the LUFA CDC driver:
http://www.fourwalledcubicle.com/LUFA.php

I think it is modified to erase, reset, and setup the programming mode over the SAM3X UART0. However I am not 100% certain.

If anyone can provide additional information regarding how the arduino IDE facilitates the programming the SAM3X through the MEGA16u2 chip using basic serial port commands/command line it would be incredibly helpful.

Thanks again.
Logged

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

Hello gaplee,

I now understand your reply. I was able to get it working with your suggestion.

First open/close the virtual com port (arduino programming port) @ 1200bps to initiate the reset.

Code:
mode com3:1200

Next use BOSSA as usual:

Code:
bossac -p COM3 -U false -i -e -w -v -b D:\file.bin -R

The following flag
Code:
-U false
must be present for this to work.

Thanks again for your help!

Best Regards,
Michael
Logged

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

Congratulations. Glad to hear you are successful.
Can I make you a friend? I am from China Shenzhen.
gapleehit@gmail.com
Logged

Pages: [1]   Go Up
Jump to: