I have a need for the Udoo to behave like a USB mouse peripheral for another computer. I thought the Arduino USB Mouse/Keyboard Library (http://arduino.cc/en/Reference/MouseKeyboard) would be an excellent choice for this. There is an example for this library where you use 5 switches to control up, down, left, right, and left_click mouse functions. I am trying to build this example sketch from an Arduino IDE 1.5.5-r2 with patch from an external computer. I removed J18, and was able to compile, upload and successfully run the blink test with an LED. So I know my setup works. Thus the problem must be in the USB side of things, which I guess the Udoo might handle a little bit differently than a regular Arduino. Has anyone build this example on an Udoo? It should be straightforward, but i can not get it detected as a mouse on my computer. Do I need to switch the USB cable from the programming port (CN6) to the other one (CN3)? That did not worked either. Do I have to put in J18 back after programming? I am confused with the whole shared serial communication between the Linux and the Arduino sides in the Udoo. Normally this would not be an issue in a regular Arduino.
Ok, so I added a couple of LEDs; a "Power" LED to indicate that it is working, which I initialize to HIGH on the setup() function, and a "status" LED to indicate activity that goes HIGH every time you press a button. These two are working as expected, but I am not seeing the USB-HID function on the external computer.
I have now compiled and uploaded the sketch from within the Ubuntu Arduino 1.5.4 IDE inside the Udoo, and I get the same behavior, the LED light up correctly, but there is no USB-HID functionality on either CN6 or CN3.
I think I have narrowed this problem down to this "How do you connect the SAM3X8E USB OTG port to an external computer". I know CN6 is for serial (to USB) communication, so that is not it. And CN3 is either disconnected or connected to the i.Mx6 depending on jumper J2. So, how do you hook up an external host to the Arduino side USB? If this is not possible it would severely limit the use cases that the Udoo can be used as an embedded controller. Think of any controller where you want to use a USB sensor of some type (host mode), or if you want your Udoo to behave as a USB peripheral like a mouse (client mode) ... at that point it would be more like a Udon't ...
Well, I looked it up myself. Bad news ... If you look at the Udoo schematics (http://udoo.org/download/files/schematics/UDOO_REV_D_schematics.pdf), pages 10 and 15, you will find that the signals we are interested in (SAM3X8E USB OTG port D+ and D-) are "USBP2_OTG_DP" and "USBP2_OTG_DN". Both of these are *ONLY* connected to the USB switch U16-AOZ6184 (http://www.aosmd.com/res/data_sheets/AOZ6184.pdf); and this switch connects them to either the i.Mx6 or nothing. And U16 (or the SAM pins for that matter) is way to small to hookup anything to it. So I guess, this definitely answers my question. Unless the i.Mx6 have a way to route those signals to other accessible pins, I think this is the end of the road. All that was needed was a board connector to these two signals so that you can hook them up to an external host while the i.Mx6 is connected to CN3. Or maybe a more complex USB switch to replace U16 that will connect either i.Mx6 to CN3, SAM3x8E to CN3, or i.Mx6 to SAM3X8E ... Udoo developers take notes for future revision ... IMHO, that is a substantial design flaw ... I guess in this case it will be Udon't ...