Programming from command line using the "Programming port"

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:

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

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.

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:

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.

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.

mode com3:1200

Next use BOSSA as usual:

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

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

Thanks again for your help!

Best Regards,
Michael

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