Arduino Due and ADK 2012

  1. adk2012 ide / mac. Please note that the libraries/core contained in the adk2012 ide differs significantly from the arduino ide. Thus the adk2012 sources are probably not compatible with the arduino ide.

  2. None. I just tested audio output. The adk2012 audio feature automatically reroutes all audio output to the adk hardware if activated. I.e. you can use every app that makes some noise (youtube, one of my virtual instrument apps ("Opus #1" / "Grand Piano" / "Keyboard Sounds"), ...). BTW: if audio stutters, you may want to adjust the size of audrecvbuf in accessory.c to the buffer size of the audio endpoint.

  3. I powered the Due via the usb cable from my mac -> due programming port. A usb power supply on the programming port seems to work too. However, a power supply on the power connector does not work for me.

Hi aleu, Great work!

I try to do same things in my environment with MacBook pro. After finish compule, ADK2012 says adk2tool /dev/tty.usbmodemfa131 erase bossac --port=tty.usbmodemfa131 -w -b ****usbaccessory.cpp.bin "No device found on tty.usbmodemfa131" adk2tool /dev/tty.usbmodemfa131 reset

Do you have any suggestion? Sho

There's an erase button on the Due. Press it for a few seconds before you upload a new sketch.

Hi aleu, Thanks a lot! It works. Now I can enjoy the sound.

It still can't work. PC-->Programming port, Nexus 7-->OTG-->Native port. Due can't be reconginzed by Nexus 7 or i9300. OS: Android 4.2.1 on Nexus 7 or i9300.

I got error when I was uploading sketch into Due board. What is wrong I did?

C:\ADK2012_IDE_0/hardware/tools/adk2tool.exe COM3 erase erasing...done. C:\ADK2012_IDE_0/hardware/tools/bossac.exe --port=COM3 -w -b C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build5785210613214747736.tmp/Arduino_Terminal_App_Sample.cpp.bin No device found on COM3 C:\ADK2012_IDE_0/hardware/tools/adk2tool.exe COM3 reset resetting...done.

Ensure you selected the right com port and read above about the erase button.

Thanks Aleu!

It should be correct com port(Arduino Due programming port on PC). And I pressed the erase button before uploading.

It seems that Due was not recognized by ADK2012 IDE after erasing (erasing done).

IDE should prompt like below if it uploads successfully? ..... Verify successful Set boot flash true CPU reset.

Hello, All I did it!!! I changed port to Native USB for uploading sketch into Due. Now I am enjoying the music from Nexus 7.

Thanks Aleu, Ardroid and all!!

Another question: I just use left channel or right channel to DAC0. Is it possible to use both of left and right channel? Thanks.

Google's ADK2012 sample actually merge left/right channel into one and output to DAC0. Yes it is possible separate L/R to DAC0/1. I am thinking about actually doing so. However, I am currently woking on attaching bluetooth HCI module. I will let you know once it done.


jangofei: Great! I have the following questions:

  1. Which Arduino IDE do you use? arduino-1.5.1r2? or adk2012_ide-win32-20120629?
  2. What app do you use on Nexus 7 to transfer data to Due?
  3. Is DC to supply power a must? Arduino Due can't work when I use a DC--3.3V & 2.0A. What DC do you use?
  1. Used ADK2012 IDE from Google
  2. This Terminal App,
  3. You can use computer's USB power and I've tested 12V DC external power also. It works either way. (Arduino DUE has some issue with USBVSB (USB Master power control) That's why usbh.c needs to updated to work properly on DUE.

I appreciate your sharing! I couldn't do it if no your help. Is it possible to share BT if you have done? I am interested everything in ADK2012. Thanks.

Hi all, I just confirmed upload of modified ADK2012 to DUE on both Mac and Win in my desk. Mac: Macbook Pro 10.6 with JDK 6 DUE: program port Win: Windows7 64bit DUE: native port (BOSSA Program port (COM**)) Thanks to aleu and jamgofei and all.

For 2ch playback, "process audio" in accessory.c seems starting point to understand and modify. Never forget erase button :)


Thanks your summary.

New question: Can’t change the volume on Nexus 7 when output audio via MicroUSB. The default volume is max volume. Do you have any ideas about it? Thanks.

Not nearly impressive but I managed to get the ADK 2012 app and the 2011 DemoKit to recognize Kevin/ardroid's sketch. This might be handy to someone or it might be completely useless. Having a control app already developed might be useful to someone.

It is worth noting, however, that this is working with the default ADK implementation that comes with Arduino 1.5.1r2 and is missing pretty much every feature available in the ADK 2012 libraries (BT, LEDs, etc). Some work would need to be done to get this library working on a vanilla Due rather than the ADK device.

Changing the version number between 1.0 and 2.0 while keeping ACCESSORY_STRING_NAME set to "DemoKit" will allow you to use the 2011 and 2012 ADK test apps, if you so desire.

#include "Arduino.h"
#include "variant.h"

// ADK1 usb accessory strings
#define ACCESSORY_STRING_VENDOR "Google, Inc."
#define ACCESSORY_STRING_LONGNAME "DemoKit Arduino Board"
#define ACCESSORY_STRING_SERIAL "0000000012345678"

#define RCVSIZE 128

USBHost Usb;

void setup(void)
  printf("\r\nADK demo start\r\n");

void loop()
  uint8_t buf[RCVSIZE];
  uint32_t nbread = 0;
  char helloworld[] = "Hello World!\r\n";

  if (adk.isReady()) {
    adk.write(strlen(helloworld), (uint8_t *)helloworld);
    delay(1000);, RCVSIZE, buf);
    if (nbread > 0) {
      printf("RCV: ");
      for (uint32_t i = 0; i < nbread; ++i) {
        printf("%c", (char)buf[i]);

If you're trying to duplicate the hardware for some reason, it might be worth checking this out.

Thanks. Is it possible to output Audio from ADK2011 board?

Got following error when I compiled your code above on ADK2012 IDE or Arduino 1.5.1r2.

C:\Users\user\AppData\Local\Temp\build5437525985664053003.tmp\sketch_jan11a.cpp.o sketch_jan11a.ino:4: fatal error: ADK.H: No such file or directory compilation terminated.

It looks like it might be a file name issue. Try changing "ADK.H" to "adk.h". If that doesn't work, check your "hardware/arduino/sam/libraries/USBHost/" directory. If the "adk.h" exists, something else might be wrong.

Please pardon the ignorance, as I'm just now getting started with this piece of the Arduino world (ADK on Due).

I noticed that in the author mentions: "The ADK2012 is based on the upcoming Arduino Due platform" - This seems to imply that ADK2012 should be directly compatible with the Due... has this not proven to be true?

djjoshuad: Please pardon the ignorance, as I'm just now getting started with this piece of the Arduino world (ADK on Due).

I noticed that in the author mentions: "The ADK2012 is based on the upcoming Arduino Due platform" - This seems to imply that ADK2012 should be directly compatible with the Due... has this not proven to be true?

I'm by no means an expert on that so someone with more knowledge of the matter should feel free to correct me.

The Due hardware is close to, if not exactly, identical to the ADK2012 kit if you take away all the bells and whistles. I've managed to get the Due working with the ADK2012 app, albeit with some latency issues. This is probably due to the 1.5.1r2 libs not supporting the newer ADK features.

The problem I've had, to my limited understanding, is that the version of the Arduino IDE that they're using for the ADK2012 resources doesn't take into account some of the quirks of the Due (eg. the 1200bps pulse prior to flashing). With the standard Arduino IDE (1.5.1r2), the libs are currently supporting the 2011 protocol. They're similar but there may be some extra functionality that will need to be added in. Trying to use Google's libs in the beta IDE fails since the ADK class names conflict and, fixing that, there's some issues with the conflicting of UOTGHS_Handler to be handled.

I know it's not meant to be exactly 1:1 functional with the ADK hardware but being able to use some of the functionality of that kit would be handy, especially the USB Audio parts. I've tried making some attempts at it but I don't know enough about the hardware to make any sort of real effort at porting all of the functionality over. Some idea about how the ADK libs function would be helpful to those of us wanting to attempt this.