UART on Apalis TK1

Helllo, I’m having dificulties with UART on Apalis TK1 with embedded linux.

According to this article: http://developer.toradex.com/knowledge-base/uart-(linux)#Apalis_TK1, in /dev directory there should be devices ttyS0, ttyTHS1, ttyTHS2, ttyTHS3. But there are only ttyS0, ttyS1, ttyS2 and ttyS3.

I tried to follow this: http://developer.toradex.com/knowledge-base/uart-(linux)#Configuration

If I try to open("/dev/ttyTHS3", O_RDWR | O_NOCTTY | O_NONBLOCK ); then -1 is returned. Device ttyS3 can be succesfully opened, but applying function tcgetattr() returns -1.

I can access and use only ttyS0.

Linux:

I’m using linux image Apalis-TK1-Mainline_LXDE-Image_2.7b2-20170410.tar.bz2

http://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/

HW:

Apalis TK1 V1.1

IXORA V1.1A

Can you please advice, how can I use UART2, UART3 and UART4?

Thank you very much

I guess that article describes our downstream NVIDIA L4T based BSP whereas the mainline one just uses mainline drivers which may have subtle differences like what you are describing now.

OK, Thank you. The “mainline” linux image does not support UART2, UART3 and UART4. The other image does (Apalis-TK1_LXDE-Image_2.7b2). But if I try to do “opkg update and opkg upgrade” on that image, the module hangs on the next boot. The “mainline” image worked that way. So, I will open that problem in the other post.

OK, Thank you.

You are very welcome.

The “mainline” linux image does not support UART2, UART3 and UART4.

The mainline BSP should really support those UARTs but unfortunately I noticed that we included a wrong compatible string in the device tree. The following patch would fix this:

diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi b/arch/arm/boot/dts/tegra124-apalis.dtsi
index f9e623b..eaea78f 100644
--- a/arch/arm/boot/dts/tegra124-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
@@ -1567,15 +1567,15 @@
        };
 
        serial@70006040 {
-               compatible = "nvidia,tegra124-hsuart";
+               compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
        };
 
        serial@70006200 {
-               compatible = "nvidia,tegra124-hsuart";
+               compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
        };
 
        serial@70006300 {
-               compatible = "nvidia,tegra124-hsuart";
+               compatible = "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart";
        };
 
        hdmi_ddc: i2c@7000c400 {

The other image does (Apalis-TK1_LXDE-Image_2.7b2). But if I try to do “opkg update and opkg upgrade” on that image, the module hangs on the next boot. The “mainline” image worked that way. So, I will open that problem in the other post.

Unfortunately opkg upgrade is rather tricky as it will update stuff from the Angstrom distribution feeds potentially overriding some local changes we had to do.

Thanks for that patch, I will try to apply it. OK, I will not use command upgrade.

You are very welcome.

BTW: I also submitted this patch mainline now.