iMX6Q UART1 set to DTE mode will be hang on.

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX6Q UART1 set to DTE mode will be hang on.

Jump to solution
1,072 Views
seanchen
Contributor III

Dear All,

We are using RS232 DTE mode full function of UART1 on iMX6Q.

Could anyone tell me how to enable DTE mode full function on UART1?

We now is set DTE mode via register "2020090" But system will hang on.

We tried to disconnect DCD pin, the hang on status will be solved,

I think isn't where setting is wrong?


Please give me suggestion.

Thank a lot.

1 Solution
151 Views
XiaoPong
NXP Employee
NXP Employee

Hi, ZL,

                In DTE mode, DCD pin is an input pin. If hangup issue happens only when MAX3242CPW connected, I would suggest consult its FAE to get help.

Best Regards,

Wilson

View solution in original post

0 Kudos
11 Replies
151 Views
YixingKong
Senior Contributor IV

Sean

After Fushi's reply, do you still have further question? If not please, keep exchanging email with him, otherwise please click Corret Answer/Helpful Answer. We would like to close the discussion if no activity in 3 days.

Thanks,

Yixing


0 Kudos
151 Views
karina_valencia
NXP Apps Support
NXP Apps Support

XiaoPong  can you continue with the follow up?

0 Kudos
151 Views
fushi_peng
NXP Employee
NXP Employee

Hi ,

Please reference the board file of iMX6Q arm2. 

static const struct imxuart_platform_data mx6_arm2_uart1_data __initconst = {

        .flags      = IMXUART_HAVE_RTSCTS | IMXUART_USE_DCEDTE | IMXUART_SDMA, /*this line enable DTE*/

        .dma_req_rx = MX6Q_DMA_REQ_UART2_RX,

        .dma_req_tx = MX6Q_DMA_REQ_UART2_TX,

};

But the arm2 board only use RTS CTS RXD TXD pins, seems you use DB9 connector , right ?

Please configure your IOMUX  carefully , check  iMX6 RM section 64.4.3 , such as :

64.4.3.6 DCD_B - Data Carrier Detect

This signal is an output in DCE mode and an input in DTE mode. If used, the DCE

device uses this signal to inform the DTE it has detected the carrier signal and the

connection will be set up. This signal remains active while the connection remains

established.

In DTE mode this input can trigger an interrupt on changing state. This is achieved by

setting to '1' the interrupt enable bit (DCD, UCR3[9]). The change state is reflected in

DCDDELT (USR2[6]). Also, the state of the Data Carrier Detect input is mirrored in the

status register DCDIN (USR2[5]).

151 Views
XiaoPong
NXP Employee
NXP Employee

Hi, Fushi and Sean,

     This afternoon, I changed board-mx6q_sabresd.h and board-mx6q_sabresd.c in order to add other 6 pins (except for ground pin), then follow SabreAI settings by adding imxuart_platform_data and modifying mx6q_sabresd_init_uart. Then, system does not start up completely for login via telnet.

     Remarked DCD, DTR, DSR, and RI from board-mx6q_sabresd.h, and leave all changes in board-mx6q_sabresd.c, then, I am able to telnet system and memtool -32 0x2020090 1 shows 0xb41 (which stands for DTE mode). Use telnet, because console does not response in DTE mode.


     Added DTR, DSR and DCD into board-mx6q_sabresd.h, I am able to telnet into system and memtool -32 0x2020090 1 shows 0xb41. Post telnet log below:

$ telnet 192.168.106.101
Trying 192.168.106.101...
Connected to 192.168.106.101.
Escape character is '^]'.


        Welcome to Freescale Semiconductor Embedded Linux Environment


freescale login: root
root@freescale ~$ /unit_tests/memtool -32 0x2020090 1
E
Reading 0x1 count starting at address 0x02020090

0x02020090:  00000B41

    Please note, if enable RI on i.MX6Q SabreSD, I cannot telnet into system. Possible reason is that i.MX6Q SabreSD uses EB3 as boot mode selector and I did not rework hardware for this verification. On customer site, RI works fine, so I ignore RI error at this moment.


Append modified board-mx6q_sabresd.h and board-mx6q_sabresd.c for your reference.    

151 Views
zlhuang
Contributor I

Dear Hung,

     I wonder if the UART1 DCD pin (EIM_D23) of your board is pulled-high, pulled-low, or floating.

     Thanks.

BRs,

ZL

0 Kudos
151 Views
XiaoPong
NXP Employee
NXP Employee

Hi, ZL,

                The EIM_D23 is pulled-high.

BRs,

Wilson

0 Kudos
151 Views
zlhuang
Contributor I

Dear Wilson,

     Our board with pull-high EIM_D23 works.

     However, it's just for debug.

     Our application utilizes this pin by connecting it to MAX3243CPW (RS-232 receiver) and it hangs the system.

     Could you test this again with similar hardware layout or give some advice?

     Thanks.

 

BRs,

ZL

0 Kudos
152 Views
XiaoPong
NXP Employee
NXP Employee

Hi, ZL,

                In DTE mode, DCD pin is an input pin. If hangup issue happens only when MAX3242CPW connected, I would suggest consult its FAE to get help.

Best Regards,

Wilson

View solution in original post

0 Kudos
151 Views
seanchen
Contributor III

We have written 1 to clear DTRD bit of UART1_USR1 in interrupt routine(imx_int(int irq, void *dev_id), drivers/tty/serial/imx.c ).

However, the interrupts still happen continuously. and now UART1_USR1=0x2040.

0 Kudos
151 Views
seanchen
Contributor III

Dear Fushi Peng,

We tried to debug in driver source(kernel_imx/drivers/tty/serial/imx.c) and add some message in interrupt routines.

        When device is DCE mode, the interrupts happen one or two times for each read/write command.

When device is DTE mode, the interrupts happen continuously, and UART1_USR1=0x20C0

        Therefore, I think the hang-up is caused by abnormal interrupts in DTE mode.

How do we to fix this issue?

Please help!!!!!

0 Kudos
151 Views
seanchen
Contributor III

Dear Fushi Peng,

Thanks for your help.

We tried to config UART1 IOMUX but system still hang on when config to DTE mode.

Could you have any suggestion for us?

The following code is our UART1 config.

static const struct imxuart_platform_data mx6_uart_pdata __initconst = {

.flags      = IMXUART_HAVE_RTSCTS | IMXUART_USE_DCEDTE ,

};

  imx6q_add_imx_uart(0, &mx6_uart_pdata);

Thank you so much.

0 Kudos