last day (15 days later) » 

4:11 PM
1
A: Why does command line BOSSA not recognize Arduino Due?

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

 
I can't see what it's doing because there are too many lines outputted. The first lines where it's calling BOSSA are being clipped away.
I found a way. Press the upload-button while in the middle of uploading. It will fail, and will not output too many lines anymore. I'm going to try it out now.
 
you can also try with a non-due (or a physical serial port with nothing attached)
 
I believe the problem was either the command line arguments, or that the board needed to be reset before connecting to it. I can't connect to it through the master bossash.exe, so it seems they've changed something on the Due rendering the master BOSSA useless. I don't quite know yet, but I'll try to leave a comment later when I've figured it all out.
 
edited my answer, as expected the reset opening theserial port with a baudrate of 1200 is a foundamental passage. Also please note that the bootload probably as a little timeout, so you have to script the execution of reset + upload to make it in the time slot.
 
Does it reset when connecting with 1200 because of some code written by Arduino? If I were to program the Due without the Arduino library, would this method stop working? Is the Arduino Bootloader which runs automatically saved to a different memory than the code we normally flash to the chip?
 
4:11 PM
no special code needed, just opening the serial at 1200baud is fine, and yes, bootloader live in a special area, like in the UNO! Util you get that reset working, you can program using wathever you want
 
Hmm, how does it know the serial is opened at 1200 baud? Isn't this a number both parts have to know on before hand?
 
automatic baudrate discovering is possible. Btw you are forgetting that this is a virtual serial over USB, some trick may apply. see /hardware/arduino/sam/cores/arduino/USB/CDC.cpp
 
Okay, I'm able to upload it now. The problem is just that after the upload, the Arduino doesn't restart, and it isn't possible to connect to it without rebooting the computer.
 
rebooting the computer?? just disconnect/reconnect the USB does not work? do you close the serial connection?
 
My mistake. Rebooting the computer worked only once. Now even the Arduino IDE does not recognize it using the native port. It finds the Due on the programming port, but cannot upload code with it. Yes, I have closed the connection.
 
4:11 PM
that's another kind of issue, i think. Developer usb works but not user? How are you compiling code? Des the pc detect the usb?
 
The PC doesn't detect the USB when connected directly to the SAM (native), but is recognized when connected to the programming port. All using the Arduino IDE, it cannot upload code through the programming USB. Might there be something wrong with the Arduino Due? When connecting RESET to GND, nothing happens.
 
hello?
when you connect the programming port, do you edit the IDE into "settings"->"board"->"arduino due (programming)"?
then
it should work
 
The strange thing is it doesn't work
 
the user USB might not work because the IDE add some code to make the skect rebootable AND what to do when rebooting.. if you compiled it externally possibilities are this code is not there
 
Sketch uses 10,380 bytes (1%) of program storage space. Maximum is 524,288 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
/home/sondre/arduino-1.5.6-r2/hardware/tools/bossac -i -d --port=ttyACM0 -U false -e -w -v -b /tmp/build8858126680904875633.tmp/sketch_apr16a.cpp.bin -R
Send auto-baud
No device found on ttyACM0
Set binary mode
Hmm
Shouldn't all that code be residing inside the USB2Serial-chip?
 
4:16 PM
that is sending RESET with 1200 baud, so you DIDN'T selected "arduino due (programming)" but you are still using "arduino due (user)"
 
I just want to thank you for helping me with this!
 
and no, the due does NOT have a USB2Serial, it use REAL usb
don't worry man :)
 
The native port is directly attached to the chip. Isn't the programming port connected to a USB2Serial?
 
well dunno, but maybe reset is still managed on the chip side
let me look at schematics
 
I selected Tools->Board->Arduino Due (Programming Port)
 
4:24 PM
ok, and that way using programming port does upload the code fine?
 
It gives the error code above
The RX LED blinks a few times before the error appears
 
that is strange, developer port should not use reset
 
Connecting RESET to GND does nothing. On the AVR boards it will make the L-light (digital 13) stop lighting up
I just tried doing it on a laptop with a fresh Ubuntu install, fresh Arduino install, and got the same error message
 
because reset on due does not work on the same way
did your code used something like watchdog?
 
No, it was just the main.cpp that comes with the Arduino library. Only modification was blinking an LED on port 13
using the delay()-function
 
4:29 PM
and you compiled it with wich compilers?
 
With the compilers of Arduino 1.5.1
/hardware/tools/g++_arm_none_eabi/bin
Sourcery I believe is the origin of the Arduin compilers. I suppose Arduino have changed some small parts of it
 
that is a lot strange
 
Do you have a Due at hand?
 
no, i'm at work :P
so
 
What happens to the L-LED when you connect RESET to GND?
Ahh, okay.
 
4:32 PM
the programming port use the 8u2
and the user port is directly connected to the chip
so when you open at 1200 you are directly taking with the chip and the code on board. Actually we can start at a situation where the uploaded code is fault for some reason.
 
Hmm, is it the chip itself which implements the reset when connected at 1200 baud? Or is it the bootloader?
 
so the user port does not work, and we need to "force Program"
is the chip
that reset itself
"Opening and closing the Native port at 1200bps triggers a 'soft erase' procedure: the flash memory is erased and the board is restarted with the bootloader. If the MCU crashed for some reason it is likely that the soft erase procedure won't work as this procedure happens entirely in software on the SAM3X."
maybe you just opened the port at 1200 baud deleting the code
 
So the bootloader is erased?
 
and not uploading nothing, so actually there is NO code on the sam, just the booloader.
the uploader is here, it libves in a protected area, with is hard to "damage"
programming port still use the 1200 baud trick to hard reset the chip
 
True, if I recall correctly, BOSSA should flash only the regular code, and not the bootloader. You'd need SAM-BA for that. I believe BOSSA was made to simplify the process and remove all alternatives you don't need for regular usage
 
4:38 PM
can you try to use developer port again?
 
Yes
I still get the same error
 
it is infact, the booloader is never touched from the two mode; that way you can "damage" the due. you have to set up special connection to upload boot-loader, just like tyou would with the uno
 
I can open the serial using gtkterm, though
mhm
 
With the board powered, press the erase button and after a second, press also the reset button. Keep them pressed for another second. Then power cycle the board and try again the bossac.
 
Is the erase button the little black button?
The reset button is the big red button?
It worked! Awesome :)
The programming port doesn't work. It hasn't worked in days though
It worked in the beginning, but not anymore...
Thank you for your help! Now I'll just have to try to upload using command line bossac again!
 
4:47 PM
:)
now it is time tyo go home
byeee
 
Hehe, good good
Bye!
 

last day (15 days later) »