Personal tools

StarSBC-6ULL RS232 example: Difference between revisions

From SomLabs Wiki

Jump to: navigation, search
Created page with "{{PageHeader|StarSBC-6ULL RS232 example}} __toc__ This tutorial shows how to send and receive data using RS232 interface on StarSBC-6ULL with communication extension board. T..."
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{PageHeader|StarSBC-6ULL RS232 example}} __toc__
{{PageHeader|StarSBC-6ULL RS232 example}} __toc__


This tutorial shows how to send and receive data using RS232 interface on StarSBC-6ULL with communication extension board. The default Yocto image build according the tutorial [[VisionSOM_imx-meta-somlabs-hardknott]] contains all required software tools.
This tutorial shows how to send and receive data using RS232 interface on StarSBC-6ULL with communication extension board SLH2-comm. The default Yocto image contains all required software tools.


=== Loop test ===
=== Loop test ===


The extension board has two RS232 interfaces available so they may be connected to perform the test in a loop. All signals are available on the J101 and J201 connectors. They should be connected according to the following table:
The SLH2-comm extension board has two RS232 interfaces available so they may be connected to perform the test in a loop. All signals are available on the J101 and J201 connectors. They should be connected according to the following table:


{| class="wikitable"  
{| class="wikitable"  
Line 24: Line 24:
| RS232-2 CTS (J201 pin 9)
| RS232-2 CTS (J201 pin 9)
|}
|}
[[File:StarSBC-6ULL-SLH2-rs232.jpg|center|500px]]


Both interfaces are already defined in the default module device-tree and are recognized as /dev/ttymxc2 and /dev/ttymxc6 devices. The device files may be used directly for reading and writing and the bitrate may be set using the stty tool:
Both interfaces are already defined in the default module device-tree and are recognized as /dev/ttymxc2 and /dev/ttymxc6 devices. The device files may be used directly for reading and writing and the bitrate may be set using the stty tool:

Latest revision as of 08:58, 13 December 2022

StarSBC-6ULL RS232 example


This tutorial shows how to send and receive data using RS232 interface on StarSBC-6ULL with communication extension board SLH2-comm. The default Yocto image contains all required software tools.

Loop test

The SLH2-comm extension board has two RS232 interfaces available so they may be connected to perform the test in a loop. All signals are available on the J101 and J201 connectors. They should be connected according to the following table:

RS232-1 signal RS232-2 signal
RS232-1 TXD (J101 pin 3) RS232-2 RXD (J201 pin 8)
RS232-1 RXD (J101 pin 4) RS232-2 TXD (J201 pin 7)
RS232-1 CTS (J101 pin 1) RS232-2 RTS (J201 pin 10)
RS232-1 RTS (J101 pin 2) RS232-2 CTS (J201 pin 9)

Both interfaces are already defined in the default module device-tree and are recognized as /dev/ttymxc2 and /dev/ttymxc6 devices. The device files may be used directly for reading and writing and the bitrate may be set using the stty tool:

root@starsbc-6ull:~# stty -F /dev/ttymxc2 9600 crtscts
root@starsbc-6ull:~# stty -F /dev/ttymxc6 9600 crtscts
root@starsbc-6ull:~# cat /dev/ttymxc2 &
[1] 465
root@starsbc-6ull:~# echo "123" > /dev/ttymxc6
123