Switching CN6 between iMX6 and SAM3X using software

Discussion in 'UDOO 101' started by SteamDinosaur, Jan 18, 2014.

  1. SteamDinosaur

    SteamDinosaur New Member

    Joined:
    Jan 18, 2014
    Messages:
    4
    Likes Received:
    0
    Hi,

    I'm quite new to the UDOO but I'm very impressed with it - I can see huge potential. I think I'm going to be making good use of the forum, though!

    For now, I have a question relating to the USB/RS232 bridge connected to CN6. The UDOO Block Diagram (http://www.udoo.org/wp-content/uploads/2013/04/UDOO_Block_Diagram_rel_1_1.pdf) suggests that it can be switched between iMX6 serial debug and SAM3X programming by manipulating GPIO7 on the iMX6, as an alternative to removing the J18 jumper. However, the UDOO pinout diagram (http://udoo.org/download/files/pinout/Udoo_pinout_diagram.pdf) marks GPIO7 as the CAN-RX input, which seems to be correct, based on some tests I've done.

    Can someone please tell me which GPIO line(s) I need to use to switch the bridge between the iMX6 and the SAM3X, or point me to the appropriate piece of documentation?

    Thanks in anticipation,

    SD
     
  2. DracoLlasa

    DracoLlasa UDOOer

    Joined:
    Oct 15, 2013
    Messages:
    419
    Likes Received:
    3
    is your goal to try and communicate with the SAM3X from your PC? if so that is not done with GPIO triggers or anything.
    Clarify the goal a bit and we will see if we can clarify how to do it
     
  3. SteamDinosaur

    SteamDinosaur New Member

    Joined:
    Jan 18, 2014
    Messages:
    4
    Likes Received:
    0
    Apologies for the delay in replying. The situation is that I want to put the UDOO on the end of a long serial line and remotely operate it using a PC connected to the CN6 port. Normally, the PC will need to communicate with the iMX6, but there may be occasions when I want it to talk directly to the SAM3X part of the UDOO. Rather than having to get physical access to the UDOO to remove and reinstate JP18, I'd like to be able to issue a command to the iMX6 from the PC which would cause it to drop the session to the PC and internally re-route the CN6 port connection to the SAM3X. I can then reset the connection at the PC end and open a session to the SAM3X

    To switch back, I would have the iMX6 monitor a shared GPIO input that I can switch the state of using the SAM3X. When the iMX6 sees the state change, it would internally switch the CN6 connection back to its own serial port, so that I can reset the serial connection at the PC end and re-establish a session back to the iMX6.

    The problem is that I cannot work out how to make the iMX6 control what the CN6 port is internally connected to. The UDOO Block Diagram I mentioned above seems to suggest that it can be done in software but does not indicate how. Can you please clarify if it is indeed possible to switch the CN6 port between the iMX6 and the SAM3X using software and, if so, how?

    Many thanks again for the reply,

    SD
     
  4. DracoLlasa

    DracoLlasa UDOOer

    Joined:
    Oct 15, 2013
    Messages:
    419
    Likes Received:
    3
    i do not think it can be done purely in software as you are describing here. based on my understanding you ultimately, at some point have to hit the jumper. That said, if you can adjust your implementation the Linux OS running on the i.MX6 can have direct constant access to the SAM3X8. Would it be possible to remotely manage linux and have it control, monitor and manage the SAM3X8 chip?

    If you dont get any other replies here you can always open a support request, but i think is probably the best i can offer at this point
     
  5. Halloween

    Halloween Member

    Joined:
    Jul 23, 2014
    Messages:
    33
    Likes Received:
    3
    Use a 2nd Arduino with Ethernet and a Relais Shield (4x) ... then you can switch all Jumpers over Ethernet.
     
  6. fetcher

    fetcher Member

    Joined:
    Mar 9, 2014
    Messages:
    166
    Likes Received:
    20
    gpio122 is the signal controlling this. The "block diagram" is wrong about gpio7 (and also about the particular UARTs involved), but there's no need for any relays or other hardware mods. Note that J18 must be removed in order for console switching via gpio to work.

    gpio122 direction = "in" (default) && J18 removed ==> CN6 routes to SAM3X (there's an external pull-up)
    gpio122 direction = "out" && value="1" && J18 removed ==> CN6 routes to SAM3X
    gpio122 direction = "out" && value="0" && J18 removed ==> CN6 routes to i.MX6
    J18 jumper present ==> (GPIO settings ignored) ==> CN6 routes to i.MX6 unconditionally

    To find the right gpio, I traced "SEL_DBG_UART" from the gate of Q4 (which controls mux chip U21 on sheet 15 of the REV_D schematic, lower left) back to the i.MX6 pin labeled DISP0_DAT5. The kernel source file arch/arm/mach-mx6/board-mx6qd_seco_UDOO.h, which controls pin muxing shows this pin name mapped as GPIO(4, 26). Each GPIO controller group has 32 signals, so group (4-3)*32 = 96 base for this group, +26 = 122.

    The schematic (UDOO_REV_D_schematics.pdf in the downloads area) is always a good place to start when trying to figure out how this board works. The colorful pinout diagram is helpful too, though it's not quite complete (check the UDOO_pinout_alternate_table.pdf also), and doesn't include signals like this one that never makes it to a connector pin. Freescale's IMX6DQRM.pdf processor reference manual can also be quite useful (just google that filename), though it's a doozy at 5000+ pages!
     

Share This Page