Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I recently bought an Arduino DUE. I was going through the technical details and realized that the DUE acts a a virtual USB device (COM port). I was wondering whether I could upgrade the Board Support Package to my own custom one. Basically I want to make it act like a true USB device or HID device. This would include rewriting the bootloader and the device drivers (on my computer).

So before I get started with my own bootloader and software, I want to know how the booting currently happens on the DUE. Do they use the same Arduino bootloader? because I read that the SAM processor has an inbuilt bootloader from the factory. Where can I find more information regarding all this? any way how does the uploading of code from Arduino IDE happen if there is no Arduino bootloader on the chip? Any kind of pointers appreciated.

share|improve this question
 
In case you, or anyone else, is still wondering about the Due's bootloader check out this link: http://playground.arduino.cc/Bootloader/DueBootloaderExplained –  user141072 May 2 '13 at 22:25
add comment

1 Answer

up vote 1 down vote accepted

You shouldn't have to rewrite the Arduino Due bootloader - you just need to write a program that can act as USB HID using the native USB port, and upload the program to the Arduino Due. You can use the Due's programming USB port to do the upload.

But here's info on the Arduino Due boot process:

The Due has a ROM bootloader that listens to the USB native port and Serial port 0. You can talk to the ROM bootloader via USB directly by resetting the SAM3X8E and using the native port. But I've not found that method to be very reliable. The more frequently used programming port is connected to an Atmel AVR 16U2 microprocessor acting as a USB-serial converter, connected to the SAM3X8E serial port 0. The Arduino 1.5 IDE can talk to the 16U2 using the Bossa command (bossac), reset the SAM3X8E, and upload new programs to it it. This page explains the Arduino Due's bootloader in detail.

If you're interested, here's the source code for the 16U2 AVR USB-serial converter.

And here's Bossa - the Due's command that corresponds to avrdude.

Using bossac (the Bossa commandline tool), you can upload code the SAM3X8E, using the builtin ROM bootloader.


On creating HID devices:

Here's a link to an Atmel application note that has example code for creating a program that can act as a USB HID keyboard:

http://asf.atmel.com/docs/latest/common.services.usb.class.hid.device.keyboard.example.sam3x_ek/html/index.html

The source code to this example is the in the Atmel ASF packages - unfortunately, a large download. Here's where to get it:

http://asf.atmel.com/docs/latest/download.html

Once you download it, the source code the HID keyboard example is in this folder:

common/services/usb/class/hid/device/kbd/example/sam3x8e_arduino_due_x

Here's a list of the other app notes, with examples of other kinds of USB and HID devices. Look for the ones that are for the Arduino Due:

http://asf.atmel.com/docs/latest/applications.html

share|improve this answer
 
Just wondering, the arduino IDE uploads the program onto the board (in case of uno/others) using avr dude itself. This is possible because there is the arduino bootloader which communicates with the avr dude on the comp side. how is this achieved in the due? other than the SAM bootloader, is there another arduino bootloader? –  deepak Nov 23 '13 at 5:47
 
The Arduino Due has a ROM bootloader that listens to the USB native port and a serial port. You can talk to the ROM bootloader via USB directly by resetting the SAM3X8E and using the native port. But I've not found that method to be very reliable. The more frequently used programming port is connected to an Atmel AVR 16U2 microprocessor acting as a USB-serial converter, connected to one of the SAM3X8E's serial ports. The Arduino 1.5 IDE can talk to the 16U2, reset the SAM3X8E, and upload new programs to it it. The link from user141072 above explains it in detail- –  Adam Nov 24 '13 at 20:19
 
If you're interested, here's the link to the source code for the 16U2 AVR USB-serial converter: github.com/arduino/Arduino/tree/ide-1.5.x/hardware/arduino/sam/… –  Adam Nov 24 '13 at 20:21
 
And here's Bossa - the command that corresponds to avdude: shumatech.com/web/products/bossa Using bossac (the commandline bossa tool), you can upload code the SAM3X8E, using the builtin ROM bootloader. –  Adam Nov 24 '13 at 20:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.