Atmel<->ARM CPU USB communication under Linux

Discussion in 'General Discussion' started by tjcruz, Jan 19, 2015.

  1. tjcruz

    tjcruz New Member

    Joined:
    Jan 19, 2015
    Messages:
    2
    Likes Received:
    0
    Just a question to the Udoo team: is it possible to make the Atmel and ARM CPUs to communicate via USB, under Linux? How ? I need to go beyond the serial transfer speed for a signal acquisition project and this would be great.

    Thanks, in advance, for your help.
     
  2. mikelangeloz

    mikelangeloz Member

    Joined:
    Jul 9, 2013
    Messages:
    129
    Likes Received:
    1
    I can imagine you can do it connecting the Atmel serial port to a serial to USB converter, and then feed it back to UDOO's USB...
    Don't think however this will improve your serial communication speed...

    Let me know
     
  3. tjcruz

    tjcruz New Member

    Joined:
    Jan 19, 2015
    Messages:
    2
    Likes Received:
    0
    In Android you can use USB OTG mode to communicate internally with the Atmel in serial CDC mode (just like in the Arduino Due, where you have a native USB interface, besides the Serial/USB interface). I wanted to know how can I enable that in Linux.
     
  4. fetcher

    fetcher Member

    Joined:
    Mar 9, 2014
    Messages:
    166
    Likes Received:
    20
    If you want the i.MX6 side of that OTG link to operate in USB Host mode (Atmel as USB target/gadget), try the kernel patch & config change I posted in this thread:
    http://www.udoo.org/forum/usb-otg-cn3-usb-host-linux-t1897.html

    But I read somewhere that the Android <--> SAM3X OTG link operates the other way around, with the Atmel as host, Android/iMX6 as Gadget/Target, which would explain why it works despite the unbonded ID pin.

    Either way, while configuring the kernel, be sure to enable Device Drivers -> USB Serial Converter Support -> USB Modem (CDC ACM) support
    if it isn't already compiled in. I think this is the driver used to talk to the "native" USB port on an Arduino Due. There are other CDC options under the "USB Gadget" section that may need to be enabled if you have the SAM3X act as host.

    This should switch the OTG mux to talk to the Atmel rather than rear connector CN3:
    echo 1 > /sys/class/gpio/gpio203/value

    You may or may not also need
    echo 1 > /sys/class/gpio/gpio128/value

    to enable the SAM3X 'Vbus' signal. That one might only be appropriate for having the SAM3X take on Host role.

    Depending on just how much extra speed you need for the inter-CPU link, note that the serial link to /dev/ttymxc3 can reliably run at 230,400bps, 460,800bps or possibly even faster. At higher rates you'll probably need some kind of flow control, but it might be easier than getting USB OTG to work, while avoiding loss of the CN3 external OTG port.
     

Share This Page