UART4 APALIS imx6

Hi,
We are using apalis imx6q.
we are trying to use UART4 with RTS and CTS enabled.
We are using these pins (134 tx, 136 rx, 177 cts , 179 rts) with this configuration:

&uart4 {
         status = "okay";
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_uart4_dte>;
         uart-has-rtscts;
};

         pinctrl_uart4_dte: uart4dtegrp {
                 fsl,pins = <
                         MX6QDL_PAD_KEY_COL0__UART4_TX_DATA      0x1b0b1
                         MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA      0x1b0b1
                         MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B      0x1b0b1
                         MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B      0x1b0b1
                 >;
         };

BUT it doesn’t work!
At the same time If we use only tx and rx without define pins for RTS and CTS it’s work.

Do you know why??

furthermore If we use UART1 with these pins(132 rx,126 tx,128 rts, 130 cts) and this configuration, it works!

    /* DTE mode */
         pinctrl_uart1_dte: uart1dtegrp {
                 fsl,pins = <
                         MX6QDL_PAD_CSI0_DAT10__UART1_RX_DATA 0x1b0b1
                         MX6QDL_PAD_CSI0_DAT11__UART1_TX_DATA 0x1b0b1
                         MX6QDL_PAD_EIM_D19__UART1_RTS_B 0x1b0b1
                         MX6QDL_PAD_EIM_D20__UART1_CTS_B 0x1b0b1
                 >;
         };

We need urgent help for UART4 .

Furthermore we found this note about XORA:

&uart4 {
         status = "okay";
         /*
          * note that uart4 is only working with pinctrl_uart24_forceoff that is
          * already defined in &uart2
          */
};

What does it mean?
is it linked with our problem?

thanks

Dear @AiLux,

How are you? Thanks for reaching out. Can you please share with us which carrier board are you using?

Also, which files are you changing?

I think that the problem with using the CTS and RTS is that these two pins are used already in other devices as you can see here: device-trees/imx6qdl-apalis.dtsi at toradex_5.4-2.3.x-imx · toradex/device-trees · GitHub. They’re both used on the CSI interface so you’d need to disable it.

From the note, I’d say you wouldn’t worry about this if the UART2 is enabled as you can see the pinctrl_uart24_forceoff here: device-trees/imx6q-apalis-ixora-v1.2.dts at toradex_5.4-2.3.x-imx · toradex/device-trees · GitHub

Please tell me if this helps.

Best regards,

Hi @gclaudino.tx ,
the CSI interface is disabled, also the peripheral cannot work is some pins are
defined into another device. UART4 is up and running and TX, RX, CTS and RTS
pins are all connected to it only.

Can you explain that note please? Why does UART4 cannot work if
pinctrl_uart24_forceoff is not in place? What is the effect of such settings?

Thanks

Hi @AiLux !

Before we can continue, please specify the following information:

  • Which exact Apalis iMX6Q are you using? Please share its whole name and version.
  • Which exact Carrier Board are you using? Please share its whole name and version.
  • Did you try to enable
  • Please share all modifications you realized
  • Please share which exact method you are using to evaluate the UART with RTS/CTS (script/source code/etc). This is really important to know how you are configuring the interface before usage.

From your last message:

Does it mean that you solved the issue? Or only RX/TX are working and RTS/CTS are not working yet?

Also, I would like to share this UART (Linux) | Toradex Developer Center article. Hopefully it can help you :slight_smile:

Best regards,

Hi @henrique.tx ,

  • Which exact Apalis iMX6Q are you using? Please share its whole name and version.

We are now using an Apalis iMX6D 1GB IT V1.1B, but we will also use V1.1C and V1.1D.

  • Which exact Carrier Board are you using? Please share its whole name and version.

Our proprietary carrier with the signals connected directly to the 232 transceiver

  • Did you try to enable

What do you mean?

  • Please share all modifications you realized

What do you mean?
No hardware changes have been made, the pins are connected directly to the 232 transceiver.

  • Please share which exact method you are using to evaluate the UART with RTS/CTS (script/source code/etc). This is really important to know how you are configuring the interface before usage.

We used minicom, enabling and disabling hardware flow control. The serial is then connected to a PC with hyperterminal.
Note that this simple test mode works fine on UART1, which is configured with CTS and RTS.

Does it mean that you solved the issue? Or only RX/TX are working and RTS/CTS are not working yet?

The serial UART4 iMX6 (UART3 Apalis) works fine without hardware flow control if only the TX and RX pins are defined in the yocto configuration.
If we add the CTS and RTS pins to this yocto configuration,
the serial no longer works, even if flow control is disabled in minicom.

Also, I would like to share this UART (Linux) | Toradex Developer Center article. Hopefully it can help you

Looking at the link it appears that there is no CTS and RTS support for the iMX6 UART4 (UART3 Apalis). However, reading the datasheet, the pins are present on the connector and appear to be used for the CSI interface.

Is it possible that there is additional hardware on the Apalis that does not allow the use of these pins as CTS and RTS?
In any case why do RX and TX no longer work when CTS and RTS pins are defined in yocto configuration even when hardware flow control is disabled?

Thanks

Dear @AiLux,

We checked on the Datasheet of the module (https://docs.toradex.com/101770-apalis-imx6-datasheet.pdf) and the RTS and CTS Functions for pins 177 and 179 are the ALT3 Function. On the same datasheet you can also see on table 4-1 that ALT3 is defined with the following bits: 011. Therefore, We’d suggest you to change

to 0x1b0b3. Can you please test it?

@henrique.tx can you elaborate more?

We would like to have a better look at your whole device tree to check if there could be any other conflict.

Best regards,

Hi @gclaudino.tx ,

we applied your suggestion (“0x1b0b3”) but nothing has changed.
Could you please answer this?

Is it possible that there is additional hardware on the Apalis that does not allow the use of these pins as CTS and RTS?
In any case why do RX and TX no longer work when CTS and RTS pins are defined in yocto configuration even when hardware flow control is disabled?

Here the device tree you asked for:
imx6q-cci-imx6.dts (8.0 KB)

Thanks

Hi @AiLux,

This was supposed to be only on RTS and CTS as the other pins were already working on their right alternate function.

We’ll be looking on your device tree to see if there’s something that we can spot that could be leading to this behavior. In the meantime, we’re also checking with our hardware team about your point.

Hi @AiLux !

Could you please share the output of dmesg?

Best regards,

Hi @henrique.tx ,

file_dmesg.txt (23.4 KB)

Regards

Hi @AiLux !

Could you please share your schematics related to this UART topic?

Best regards,

Hi, you find it attacched.
Schemi_Seriali_CCI.pdf (1.6 MB)

Hi @henrique.tx @gclaudino.tx

any news about uart problem?
It is very critical for us to know if it is possible use this usart with cts and rts because we have our production stopped.

Thanks

Hi @AiLux !

We tried to take a look at your PDF schematic, but we can’t perform a text search on it. Could you please share a PDF that allows text search? This will make everything easier :slight_smile:

Thanks!

@henrique.tx Do you use Altium designer?
if i send to you these three files in .SchDoc could be ok?

Hi again, @AiLux ! :stuck_out_tongue:

We just checked again your device tree that you shared

On line 295 and 296, could you test swapping RTS and CTS in pinctrl_uart4_dte (between pins MX6QDL_PAD_CSI0_DAT16 and MX6QDL_PAD_CSI0_DAT17)?

Best regards,

Hi @AiLux ,

Unfortunately I don’t use Altium designer.

@henrique.tx
Try with this PDF!
SerialsI_extract.pdf (778.7 KB)

Thanks

@henrique.tx

Hi
we will try and will inform you, but i suspect that we have tried already in the past. The person who knows this come back on monday.

Thanks

Hi @AiLux !

I was able to communicate using UART with RTS/CTS between:

  • Apalis iMX6D 512MB V1.1B + Ixora V1.1, and
  • Colibri iMX6DL 512MB V1.1B + Iris V1.1

I used only TTL level. On Ixora, I used the pins:

Apalis pin name iMX6 Ball name SODIMM number Ixora pin On device tree overlay
CSI0_DATA13 CAM1_D1 185 X14.8 MX6QDL_PAD_CSI0_DAT13__UART4_TX_DATA 0x1b0b1
CSI0_DATA12 CAM1_D0 187 X14.7 MX6QDL_PAD_CSI0_DAT12__UART4_RX_DATA 0x1b0b1
CSI0_DATA16 CAM1_D4 179 X14.11 MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B 0x1b0b1
CSI0_DATA17 CAM1_D5 177 X14.12 MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x1b0b1

These Apalis pins are also referenced on node adv_7280, but this node is disabled by default.

For completeness, by default, we have the following on Colibri iMX6:

Colibri pin name iMX6 Ball name SODIMM number Iris pin On device tree
UART_B TXD SD4_DATA4 38 X16.32 MX6QDL_PAD_SD4_DAT4__UART2_TX_DATA 0x1b0b1
UART_B RXD SD4_DATA7 36 X16.31 MX6QDL_PAD_SD4_DAT7__UART2_RX_DATA 0x1b0b1
UART_B RTS SD4_DATA6 34 X16.30 MX6QDL_PAD_SD4_DAT6__UART2_RTS_DATA 0x1b0b1
UART_B CTS SD4_DATA7 32 X16.29 MX6QDL_PAD_SD4_DAT5__UART2_CTS_DATA 0x1b0b1

To use this interface on TTL level, we also need to disable the RS232 IC, as noted on the Iris’ datasheet. This is done by setting the SODIMM 104 (gpiochip1 - line 8) to low.

Here is a screenshot of both modules communicating

And here is the device tree overlay for Apalis iMX6:

/dts-v1/;
/plugin/;

#include <imx6q-pinfunc.h>

/ {
        compatible = "toradex,apalis_imx6q";
};

&uart4 {
    pinctrl-0 = <&pinctrl_uart4_dte>;
    status = "okay";
};

&adv_7280 {
    status = "disabled";
};

&pinctrl_uart4_dte {
    fsl,pins = <
        MX6QDL_PAD_CSI0_DAT13__UART4_TX_DATA 0x1b0b1
        MX6QDL_PAD_CSI0_DAT12__UART4_RX_DATA 0x1b0b1
        MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B 0x1b0b1
        MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x1b0b1
    >;
};

Let me know if this helps you.

Best regards,

1 Like