user693: Running Ubuntu 12.04.4 LTS (64 bit) I try to upload my code to the Arduino Due through the Native port. I have tried both the bossac that ships with the Arduino IDE (which is a modified version of BOSSA), and the master BOSSA branch.
Running this command:
sudo ./bossac -p /dev/ttyACM0

I get this error:
No device found on /dev/ttyACM0

However, it works perfectly inside the Arduino IDE.
What can the problem be?

user48766: The Arduino CLI uses a slightly different version of bossa from the one that is on master:
https://github.com/shumatech/BOSSA/tree/arduino
On Linux, I was able to do the following:
$ git clone git@github.com:shumatech/BOSSA.git
$ cd BOSSA
$ make bin/bossac -j4
$ stty -F /dev/ttyACM0 1200
$ ./bin/bossac --port=/dev/ttyACM0 --force_usb_port=true -e -w -v -b /path/to/my/firmware.bin -R

(I got the answer from this Arduino forum thread.)

user4727: Easiest way I've found to do this purely from the terminal:
stty -f /dev/cu.usbmodemfa121 1200;stty stop /dev/cu.usbmodemfa121;./bossac -i -d --port=tty.usbmodemfa121 -U false -e -w -v -b Blink.cpp.bin -R

Swap out the serial device for whatever /dev you are using; in Linux you may have to sudo to get direct access to the device.
This is assuming you are in the directory where bossac lives and your .bin file is there too. Adjust to suit your needs.
If using the native USB port you should change -U to true

user643: from the IDE's menu you can activate the verbose upload (and compile) mode, that will print all the command executed; Probabibly what you miss is the necessity to open the serial at 1200baud, that will trigger the reboot and consequent bootloader's start ont DUE chip, and bossac need to find the bootloader. see autoReset
edit: i've now a pc with a physical Serial, so i've tryed to upload in verbose mode:
Sketch uses 10,380 bytes (1%) of program storage space. Maximum is 524,288 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyS0
/home/xxx/arduino-1.5.6-r2/hardware/tools/bossac -i -d --port=ttyS0 -U false -e -w -v -b /tmp/build8035422101690460839.tmp/sketch_apr14a.cpp.bin -R 

as you can see he is resetting the board by opening the serial at 1200, forcing the bootloader to start. You have to do the same on your script befor launching bossac. How this can be done depends on your OS
Please note that the reset is triggered by the 8u2 chip used as USB to serial adapter on the arduino board, so bypassing it by connecting through tx/rx pin (like using your own conversor, like in my example with hardware serial) won't work unless you do a manual reset at the right time

693: <p>Running Ubuntu 12.04.4 LTS (64 bit) I try to upload my code to the Arduino Due through the Native port. I have tried both the <code>bossac</code> that ships with the Arduino IDE (which is a modified version of BOSSA), and the master BOSSA branch.</p>

<p>Running this command:</p>

<pre><code>sudo ./bossac -p /dev/ttyACM0
</code></pre>

<p>I get this error:</p>

<pre><code>No device found on /dev/ttyACM0
</code></pre>

<p>However, it works perfectly inside the Arduino IDE.</p>

<p>What can the problem be?</p>
 48766: <p>The Arduino CLI uses a slightly different version of bossa from the one that is on master:</p>

<p><a href="https://github.com/shumatech/BOSSA/tree/arduino" rel="nofollow noreferrer">https://github.com/shumatech/BOSSA/tree/arduino</a></p>

<p>On Linux, I was able to do the following:</p>

<pre><code>$ git clone git@github.com:shumatech/BOSSA.git
$ cd BOSSA
$ make bin/bossac -j4
$ stty -F /dev/ttyACM0 1200
$ ./bin/bossac --port=/dev/ttyACM0 --force_usb_port=true -e -w -v -b /path/to/my/firmware.bin -R
</code></pre>

<p>(I got the answer from <a href="https://forum.arduino.cc/index.php?topic=150195.0" rel="nofollow noreferrer">this Arduino forum thread</a>.)</p>
 4727: <p>Easiest way I've found to do this purely from the terminal:</p>

<pre><code>stty -f /dev/cu.usbmodemfa121 1200;stty stop /dev/cu.usbmodemfa121;./bossac -i -d --port=tty.usbmodemfa121 -U false -e -w -v -b Blink.cpp.bin -R
</code></pre>

<p>Swap out the serial device for whatever /dev you are using; in Linux you may have to sudo to get direct access to the device.
This is assuming you are in the directory where bossac lives and your .bin file is there too. Adjust to suit your needs.
If using the native USB port you should change -U to <em>true</em></p>
 643: <p>from the IDE's menu you can activate the verbose upload (and compile) mode, that will print all the command executed; Probabibly what you miss is the necessity to open the serial at 1200baud, that will trigger the reboot and consequent bootloader's start ont DUE chip, and bossac need to find the bootloader. see <a href="http://arduino.cc/en/Guide/ArduinoDue#toc4" rel="nofollow">autoReset</a></p>

<p>edit: i've now a pc with a physical Serial, so i've tryed to upload in verbose mode:</p>

<pre><code>Sketch uses 10,380 bytes (1%) of program storage space. Maximum is 524,288 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyS0
/home/xxx/arduino-1.5.6-r2/hardware/tools/bossac -i -d --port=ttyS0 -U false -e -w -v -b /tmp/build8035422101690460839.tmp/sketch_apr14a.cpp.bin -R 
</code></pre>

<p>as you can see he is resetting the board by opening the serial at 1200, forcing the bootloader to start. You have to do the same on your script befor launching bossac. How this can be done depends on your OS</p>

<p>Please note that the reset is triggered by the 8u2 chip used as USB to serial adapter on the arduino board, so bypassing it by connecting through tx/rx pin (like using your own conversor, like in my example with hardware serial) won't work unless you do a manual reset at the right time</p>
