SAM3X USB to imx6q under Linux

Discussion in 'General Programming Discussion' started by filipxsikora, Oct 2, 2015.

  1. filipxsikora

    filipxsikora New Member

    Joined:
    Feb 11, 2015
    Messages:
    5
    Likes Received:
    0
    Hello,
    I would like to ask, how to connect SAM3X's native USB port to imx6q's USB port under Linux(UDOOBuntu). As it seems from reference manual, the port is connected like I want it under Android by default, but not under Linux. I've studied schematics and there is USB switch controlled by some GPIO from imx6q (part U16, AOZ6184). however, the switching signal "USB_OTG_SEL" leads nowhere. I need to gather data from SAM3X at much faster speeds that default serial connection allows me to.
    Which GPIO controls the USB switching circuit, especially it's USB_OTG_SEL signal ?
    Thanks for reply.

    Best regards,
    Filip.
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi filipxsikora!
    The same documentation of Android is valid: http://www.udoo.org/docs/Android/UDOO_Switch_Between_Adb_Debug_And_ADK_Connection

    Follow the section that tells "Switch from Debug Mode (MicroUSB plugged in CN3) to INTERNAL ADK mode (i.Mx6 <-> SAM3X)"

    Under Linux you have to add these commands (you'll probably need root's privilege)

    Code:
    echo 128 > /sys/class/gpio/export
    echo 203 > /sys/class/gpio/export
    
    echo 1 > /sys/class/gpio/gpio128/value
    echo 1 > /sys/class/gpio/gpio203/value
     
  3. filipxsikora

    filipxsikora New Member

    Joined:
    Feb 11, 2015
    Messages:
    5
    Likes Received:
    0
    Thank you for your reply.
    Unforunetaly it is not working.
    I cannot export mentioned GPIO's, but they are exported already. (I'm using UDOOBuntu 1.1 on UDOO Quad).
    I can however write values to them, but it's not doing anything. I have connected jumpers J2 and J18.
    So I will describe my procedure to check if I haven't messed anything.
    1. I upload my program to SAM3X from JTAGICE3 from Atmel using JTAG pins on UDOO.
    2. I write 1 to GPIO's 128 and 203 from Linux terminal at UDOO.
    3. I try command "lsusb" from Linux terminal, my device is nowhere.
    4. I reset SAM3X by jumper (I've tried also reset by JTAGICE3)
    5. I try "lsusb" again, my device is still not shown.
    I have also separate Arduino DUE, where I've tried my code and it is working fine there using Arduino DUE's native USB port connected to UDOO's USB port.
    When I try "lsusb" with my Arduino connected, my device is normally detected.
    Am I doing something wrong there ?
    Thank you.
     
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    It's not obvious that the Linux Kernel have activated all the necessary modules to see SAM3X as native port, because we don't support this functionality under Linux.
     
  5. filipxsikora

    filipxsikora New Member

    Joined:
    Feb 11, 2015
    Messages:
    5
    Likes Received:
    0
    That's a pitty really. Because from my tests, I was able to get around 150Mbps transfer rate from my Arduino DUE. Sometimes it's good or even crucial to get more than 1Mbps (more or less, speed depends on many things) from UART.
     

Share This Page