Arduino Due and ADK 2012

I am in the same boat as lier. Can someone describe the process for compiling and uploading sketches from the ADK 2012 IDE to the Due? Uploading from Arduino IDE works fine for me but not the ADK.

Hi,

I am trying the ADK2012 code on Due and facing the following Compiling Error. I saw someone mention the problem, but could not find a way to resolve it.

"C:\Users\xyz\Desktop\arduino-1.5.2-windows\arduino-1.5.2\hardware\arduino\sam\variants\arduino_due_x/libsam_sam3x8e_gcc_rel.a(uotghs.o): In function UOTGHS_Handler': uotghs.c:(.text.UOTGHS_Handler+0x0): multiple definition ofUOTGHS_Handler' ADK2\usbh.c.o:C:\Users\xyz\Desktop\arduino-1.5.2-windows\arduino-1.5.2\libraries\ADK2/usbh.c:684: first defined here collect2: ld returned 1 exit status"

So, did anyone got around the UOTGHS_Handler conflict yet? I was able to compile and upload just fine with the ADK2012 IDE version, but not with 1.5.2 I had to use the native port, which requires me to press erase before the upload and also requires me to disconnect the usb cable to plug the OTG cable. I'd love to be able to upload through the programming port instead and use bossac instead of adk2install. So, if anyone was able to get around the UOTGHS_Handler issue, please let me know or pm me. Thanks in advance.

Ok, I just wanted to post my progress. I was able to compile and upload the terminal code posted on the original thread to a Due board using IDE 1.5.2 using the programming port. The original ADK2012 IDE required the native port. After digging for a few days and comparing with the Google released ADK2012, I realized the problem is with the arduino reset code built-in on the libs to erase the flash when native port is used for programming (AKA open serial at 1200bps). By having this code enabled all the time will disable the native port from ever being able to act as OTG port. But the trick is that if this code is not enabled, you won't be able to erase flash and upload using native port on a single shot. You will need to press the ERASE button. In my case, I'm never planning on using the native port for uploading code anyway, so my solution works out great for me. My solution was to create a new board reference in the boards.txt file and remove the flags for the CDC serial on native port.

New_Board.name=My Own Board
New_Board.upload.tool=bossac
New_Board.upload.protocol=sam-ba
New_Board.upload.maximum_size=524288
New_Board.upload.use_1200bps_touch=true
New_Board.upload.wait_for_upload_port=false
New_Board.upload.native_usb=false
New_Board.build.mcu=cortex-m3
New_Board.build.f_cpu=84000000L
New_Board.build.core=arduino
New_Board.build.extra_flags=-D__SAM3X8E__ -mthumb
New_Board.build.ldscript=linker_scripts/gcc/flash.ld
New_Board.build.variant=arduino_due_x
New_Board.build.variant_system_lib=libsam_sam3x8e_gcc_rel.a

And add an ifdef on the USBCore.cpp to disable the CDC code.

#ifdef USBCON

Original USBCore.cpp code goes inside the ifdef. I can't add or the post is too long and exceeds the maximum allowed length of forum, which is 9500 characters.

#endif // USBCON

Thanks for your post, its really helpful for a newbie like me. I just need to know how did you connect speaker. I have this speaker as shown in the attached image. Can I directly connect it to DAC0 and GND pins of Arduino? if not please suggest.

image (1).jpeg

DO NOT connect directly your speaker to the DAC pin. Please, read and follow the following updated tutorial.

http://arduino.cc/en/Tutorial/SimpleAudioPlayer

Regards!

jangofei: 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.

Guys, I'm trying to use a MEGA ADK and I arrived at the same point: troubles in detecting the MEGA on the COM. Any suggestions? tnx! a

You must use native port

Thanks, I'll try! a

@newhobby, connecting the MEGA ADK using native usb, windows doesn't see anything on the usb. Is there any driver to install to make the pc see the port?

I think you are in the wrong thread.
This is for a Due board and not Mega.
Also, maybe you ought to start with blink code before you start trying to use Goodle ADK stuff.

I'm sorry but i didn't found any mega adk thread. If you know where is it, would you be so kind to tell me? No problem with adk 2011 so far, but as i read through the forums adk 2012 is not so immediate. Thanks Andrea

Hello,

i'm trying to use a Due with a Nexus4 phone. I've compiled an loaded the sample successfully (thanks to your code modifications tips :)), but when i plug the Due on the Phone, the phone battery charge status start to blink, and i get a repeated "disconnected" message in the arduino serial console. (the phone detect an adk accessory sometimes, somtimes not...) I use a USB-A female <-> micro-B male on the phone side (not referenced as OTG), is it a problem ?

Another question, has anyone tested a blutooth shield on the Due ? and the ADK2-over-BT feature ?

Thanks.

Anthony.

Have you tried using an external power source? I was fighting trying to get this to work with my Galaxy S4, had no luck til I plugged in a wall wart.

I am using an OTG adapter though...

Yes, i’ve tried this weekend with a power supply and it’s now working perfectly :smiley:

Hi all,

I've tried this example and it worked: http://arduino-er.blogspot.com.br/2013/04/arduino-due-android-adk-change-led.html?view=classic Is this example use "ADK 2012"?

Just another question, someone know what's the advantage to use processing (http://stream.tellart.com/controlling-arduino-with-android/) Someone built the communication of Arduino due + Android app developed with processing?

Thank you.


Processing + Eclipse + Android + Arduino Due (USB and adk.h)

The video example working: http://goo.gl/FGmYLe

based on example: http://android-er.blogspot.com.br/2013/03/adk-example-control-arduino-due-led.html

Phone: 4.1.2 GT-S6812B


newhobby: And add an ifdef on the USBCore.cpp to disable the CDC code.

#ifdef USBCON

Original USBCore.cpp code goes inside the ifdef. I can't add or the post is too long and exceeds the maximum allowed length of forum, which is 9500 characters.

endif // USBCON

Hello and thanks to everybody in this thread now i'm able to upload a working sketch to my arduino that can communicates with my android mobile phone. I have one question about programming arduino DUE. Until now i was able to upload working sketch only with native port. i read that there is a solution to use the programming port and the native port. I unaderstand almost everything escept the part tha i quoted. Anybody can explain me this part?

Thanks in advance.

Hi everyone! Thank you to everyone in this thread. Special thanks to ardroid. I have finally made arduino due usb audio work. I would like to make BT audio work too. Has anyone here succeeded on it? Google's adk2012 was using custom ckt and stack with TI cc2564. It's not available in the country I'm in and it's also smd which is difficult for me to solder some pins into. I tried using HC-06 but it only supports serial communication. If you were able to succeed BT audio, could you share what BT module or chip you used and some code maybe?