UART Ports

Discussion of your EDM baseboard, your add-on boards or other peripherals for your wandboard.

UART Ports

Postby Wicked One 612 » Fri Feb 14, 2014 3:28 am

I have a need to use 2 serial peripherals (just TX and RX, no need for RTS and CTS). I understand that one UART is being directed to the bluetooth chip (Wandboard-dual). The other is accessible through the RS232 connector and usable so long as the console is disabled. And the third, if I understand correctly, is not accessible at all on the Wandboard?

If that's the case, is there any way that I can connect two serial devices to the Wandboard Dual? Could I potentially use the Bluetooth's serial, as I am not using Bluetooth on the board? Also what would be the pins for connecting to it if I can use it.

Thank you!
Wicked One 612
 
Posts: 19
Joined: Fri Oct 11, 2013 2:54 am

Re: UART Ports

Postby rfindley » Tue Feb 25, 2014 10:22 pm

Does your situation allow use of a USB-to-serial dongle? I've tested an FTDI-based USB-to-serial dongle, and it works fine.

The one I'm using is the US232R-10 at the following link, though most such devices built in the last 5 years or so should work fine:
http://www.ftdichip.com/Products/Cables/USBRS232.htm

-Robin
rfindley
 
Posts: 18
Joined: Fri Nov 22, 2013 7:44 pm

Re: UART Ports

Postby Wicked One 612 » Fri Feb 28, 2014 1:59 am

I did try that, but I didn't want to go through figuring out how to disable the console on the RS232 and then level convert it and all that business.

I solved it and for anyone else finding themselves in a similar problem, here's my solution:

First you have to edit a Wandboard source file (board-wand.c). If you're using yocto this is located at: yocto/build/tmp/work/wandboard_dual-poky-linux-gnueabi/linux-wandboard/3.0.35-r0/git/arch/arm/mach-mx6.

Add the following code below the wand_init_uart() function:
Code: Select all
/****************************************************************************
 *
 * Initialize second UART (UART2)
 *
 ****************************************************************************/

static const struct imxuart_platform_data wand_external_uart_data = {
   .flags = IMXUART_HAVE_RTSCTS,
   .dma_req_tx = MX6Q_DMA_REQ_UART2_TX,
   .dma_req_rx = MX6Q_DMA_REQ_UART2_RX,
};

static __init void wand_init_external_uart(void) {
        /* UART2 is on SD4_DAT4-7 */
        IMX6_SETUP_PAD( SD4_DAT4__UART2_RXD );
        IMX6_SETUP_PAD( SD4_DAT5__UART2_RTS );
        IMX6_SETUP_PAD( SD4_DAT6__UART2_CTS );
        IMX6_SETUP_PAD( SD4_DAT7__UART2_TXD );

        imx6q_add_imx_uart(1, &wand_external_uart_data);
};


Add the following line of code in the wand_board_init() function:
Code: Select all
   wand_init_dma();
   wand_init_uart();
   wand_init_external_uart();
   wand_init_sd();


You then have to re-compile the kernel, or if you're using yocto run this at the build directory:
Code: Select all
$: bitbake -f -c compile linux-wandboard
$: bitbake -c deploy linux-wandboard


Copy it to the SD card and overwrite the existing uImage by running this command at yocto/build/tmp/deploy/images/wandboard-dual:
Code: Select all
$: sudo cp uImage /media/USER/Boot\ wandbo/


This enables UART2 for use (ttymxc1 if you're using Yocto).

When you're in Yocto, run these commands to configure it properly:
Code: Select all
stty -F /dev/ttymxc1 115200
stty -F /dev/ttymxc1 raw
stty -F /dev/ttymxc1 -echo -echoe -echok


Write and read by running these:
Code: Select all
$: echo "HELLO" > /dev/ttymxc1
$: cat /dev/ttymxc1


For the physical interface, I couldn't find any pins that were routed to the expansion header. So I had to solder directly to the pads on the underside of the board. The following pads contain the UART2 signals:
Code: Select all
TP121: CTS
TP123: TXD
TP135: RXD
TP126: RTS


If you just want straight serial with no flow control, pick up the TX and RX signals, ground the CTS and leave RTS floating (don't connect anything to it).

Hopefully that helps someone else! I had a hell of a time figuring it out.
Wicked One 612
 
Posts: 19
Joined: Fri Oct 11, 2013 2:54 am

Re: UART Ports

Postby ArmFan » Fri Feb 28, 2014 9:38 am

Hello,

thank you, seems very interesting. Currently I was too looking for second serial port. Don't know whether I should dare to solder on the testpoints.

I will check the manual, maybe I can route a uart to some pins on expansion header.

Here is what I found (page 5178 in RM of imx6q):
UART2_RX_DATA -> EIM_D27 ALT4 -> GPIO3_27 (expansion)
UART2_TX_DATA -> EIM_D26 ALT4 -> GPIO3_26 (expansion)

but CTS and RTS is not easy.

UART1 is serial port and UART3 is BCM chip, so this is no option.
ArmFan
 
Posts: 21
Joined: Sun Feb 02, 2014 11:01 am

Re: UART Ports

Postby Wicked One 612 » Fri Feb 28, 2014 5:07 pm

ArmFan wrote:Hello,

thank you, seems very interesting. Currently I was too looking for second serial port. Don't know whether I should dare to solder on the testpoints.

I will check the manual, maybe I can route a uart to some pins on expansion header.

Here is what I found (page 5178 in RM of imx6q):
UART2_RX_DATA -> EIM_D27 ALT4 -> GPIO3_27 (expansion)
UART2_TX_DATA -> EIM_D26 ALT4 -> GPIO3_26 (expansion)

but CTS and RTS is not easy.

UART1 is serial port and UART3 is BCM chip, so this is no option.


Hmm, interesting idea. I'd take a multimeter and test the impedance between the test point and the expansion pin. The soldering was definitely not trivial. It takes a steady hand, some 30AWG wire, and a lot of patience, but it'd doable.
Wicked One 612
 
Posts: 19
Joined: Fri Oct 11, 2013 2:54 am

Re: UART Ports

Postby ttwand » Fri Mar 03, 2017 1:08 pm

Wicked One 612 wrote:
Code: Select all
TP121: CTS
TP123: TXD
TP135: RXD
TP126: RTS





TP125 is RXD :idea: :idea: :idea:
ttwand
 
Posts: 12
Joined: Fri Jun 10, 2016 6:37 am


Return to Hardware and peripherals

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests