[Solved]Connect a external Arduino to your Udoo?

Discussion in 'General Discussion' started by problemer, Apr 8, 2014.

  1. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Hello,

    There must be someone who have tried to connect an extra Arduino to the udoo board. Where you able to establish a serial connection? How did you do it.
     
  2. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    I got it working with my Arduino Uno today on my Debian Wheezy image. The procedure is most likely the same for Ubuntu.

    1. The Udoo Arduino version is specific for the embedded Due and cannot be reused for external boards. I installed Arduino IDE from package repository. For my Debian Wheezy I have configured Jessie testing repository and got version 1.0.5 from Jessie in order to also support my Esplora board. No doubt other means of installation can be used, and plenty of information around the web on how to get the regular Arduino IDE installed on Linux.
    2. With additional Arduino IDE working, I could select board but not serial port. Turns out that Arduino boards uses the CDC ACM for communication, but default Udoo kernel does not install this module. I got the Udoo kernel source and in menuconfig added cdc_acm module (Device Drivers —> USB support –> USB Modem (CDC ACM) support). With new kernel+module the /dev/ttyACM0 serial port is available, and no problem uploading sketches or using Serial Monitor.

    So, external Arduino through regular USB commication is working 100%. And with both "Arduino UDOO" and "Arduino IDE" installed in paralell I get both working at the same time. The Debian Wheezy image comes without any Arduino software, so it is easier to ensure that the installs stays separate. More care must likely be taken for Ubuntu image if getting more than one version from package repositories.

    What I haven't quite yet got working is using FTDI interface that I have for some custom Arduino boards ("Ardweeny"). The ftdi module is actually enabled in default kernel, so attaching this board and trying the Arduino loopback test (search the Arduino forums for details of this test) I get full serial commication with the board (even with default kernel). I think my only remaining problem with FTDI is an outdated Debian Wheezy version of avrdude or its dependencies. Please let me know if anyone gets FTDI working too.
     
  3. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    Great! and thanks!
     
  4. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    And btw...

    I'm not intressted in uploading code from the Udoo, all i want to do is to establish the serial connection through usb, so i figure re-compiling the kernel would do it?
    Gonna try it atleast.
     
  5. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    Yes. Without recompiling kernel I get FTDI serial communication working (aka /dev/ttyUSB0), but with recompile and added cdc_acm module I also get the standard /dev/ttyACM0 port. Successful Arduino serial loopback test with both interfaces.
     
  6. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    BTW, code upload through FTDI still eludes me. It may be a case of getting avrdude and drivers at http://www.ftdichip.com/Drivers/D2XX.htm connected somehow.

    Any insights appreciated.
     
  7. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    False alarm. Turned out the default drivers worked fine. It was a problem with default avrdude upload speed of "-b115200" for Uno board. This speed is fine for regular ACM, but it was too fast for the Udoo / FTDI / atmega 328 combination. In the end I made a custom board definition in boards.txt with baud rate of 57600.

    So, all that is needed is the kernel cdc_acm module. Perhaps include this module in the default kernel builds by Udoo?
     
  8. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    Would be nice to here how you got serial communication to work with USB0 without compiling the kernel?
     
  9. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    I just plugged my FTDI-connected device in. To verify that it wasn't anything I've done I also just started a clean version of the latest Debian 1.1 image relased a few days ago, and the device shows up there to using the provided ftdi_sio kernel module.

    A regular Arduino USB connection though needs the ACM0. And for that I needed to add the kernel module. That will load the cdc_acm module when connected and provide a device for it. There is no device and no loaded module for the Arduino without adding it and recompiling kernel.
     
  10. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    Yeah, figure i missed something out. Had to look up the FTDI-thingy, gonna re-compile. Downloading kernel, seems like a bit of a hustle to change kernel once its compiled tough.
     
  11. osimons

    osimons New Member

    Joined:
    Apr 7, 2014
    Messages:
    9
    Likes Received:
    0
  12. problemer

    problemer New Member

    Joined:
    Mar 26, 2014
    Messages:
    18
    Likes Received:
    0
    Re: Connect a external Arduino to your Udoo, how did you do

    Great! You're a true hero! :)
     

Share This Page