Go Down

Topic: Programming from command line using the "Programming port" (Read 1 time) previous topic - next topic

mkabatek

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: [Select]
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


gaplee

#1
Jan 13, 2013, 03:04 am Last Edit: Jan 15, 2013, 02:54 pm by gaplee Reason: 1
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.

mkabatek

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.

mkabatek

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: [Select]
mode com3:1200

Next use BOSSA as usual:

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

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

Thanks again for your help!

Best Regards,
Michael

gaplee

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

Go Up