how to enable uart4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to enable uart4

Jump to solution
2,511 Views
mingmingyuan
Contributor III

we use mx6q sabresd board and run linux 3.0.35, now I want to use uart4,but I can't find ttymxc3 in /dev/

I read porting guide for this, I add follow code in board.c, after add this code, I can find ttymxc3 in /dev, but this uart can't send or receive data.

// yuanmm add uart begin
imx6q_add_imx_uart(1, NULL);
imx6q_add_imx_uart(3, NULL);
imx6q_add_imx_uart(4, NULL);
// yuanmm add uart end

test step:

cat /dev/ttymxc3 &

echo ymm > /dev/ttymxc3

1 Solution
1,943 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi mingmingyuan,

Your step is OK. Sorry for late reply. I wonder if your uart4 can work now?

Have a nice day
Dan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
11 Replies
1,943 Views
saurabh206
Senior Contributor III

Hi


Please check the UART setting (e.g. DMA enable, flow control setting) in the linux/arch/arm/mach-mx6/serial.h.


Thanks

Saurabh

0 Kudos
Reply
1,943 Views
mingmingyuan
Contributor III

I don't modify other code after I got bsp code , as your mean, bsp code can't support uart when use default setting( e.g DMA and flow control)

0 Kudos
Reply
1,943 Views
saurabh206
Senior Contributor III

Hi

It may possible that UART4 is not used so it might be disabled, so it better to verify.

It should be like

#define UART4_UCR4_CTSTL        16

#define UART4_DMA_ENABLE 1

#define UART4_DMA_RXBUFSIZE    512

#define UART4_UFCR_RXTL        16

#define UART4_UFCR_TXTL        16

Thanks

Saurabh

0 Kudos
Reply
1,943 Views
mingmingyuan
Contributor III

OK, thank you for your help, I think your suggestion is right.

I will check this.

0 Kudos
Reply
1,943 Views
mingmingyuan
Contributor III

I have modified code, but uart4 can't work still.

/* UART 4 configuration */

#define UART4_UCR4_CTSTL        16// yuanmm change to 16 before is -1

#define UART4_DMA_ENABLE 1// yuanmm change to 1 before is 0

#define UART4_DMA_RXBUFSIZE     512// this number I have tried 512 and 1024

#define UART4_UFCR_RXTL         16

#define UART4_UFCR_TXTL         16

0 Kudos
Reply
1,943 Views
mingmingyuan
Contributor III

hi fsl:

any update?

0 Kudos
Reply
1,943 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi mingming yuan,

Here I have a document for Debug UART Customization on i.MX6x. There are steps about how to modify you can refer to .

In the attachment you can see the document. Hope this can help you.
Have a great day
Dan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,943 Views
mingmingyuan
Contributor III

Hi DanWang:

thank you for provide me document,I will read this doc and respond as soon as  possiable.

0 Kudos
Reply
1,943 Views
mingmingyuan
Contributor III

Hi danwang:

thank you for your support.

I have read this ppt and modified code for test, but uart4 can't work still.

this is my step, can you help to double check?

I want to use uart4 for data transmit in kernel not for debug, So I think I only need to modify code in kernel, needn't modify uboot and MFT code.

ppt description for board-mx6q_arm2, but I use sabresd board, so I need to modify Board-mx6q_sabresd.c and releational file.

1,arch\arm\mach-mx6\serial.h

I check uart4 configration and only change UART4_UCR4_CTSTL from -1 to 16, other configration use default setting

/* UART 4 configuration */

#define UART4_UCR4_CTSTL        16// yuanmm change to 16 before is -1

#define UART4_DMA_ENABLE 0

#define UART4_DMA_RXBUFSIZE     512

#define UART4_UFCR_RXTL         16

#define UART4_UFCR_TXTL         16

2, arch\arm\mach-mx6\Board-mx6q_sabresd.h

add code as follow,as hareware design, We use pad csi0 data12 and data13,not PAD_KEY_COL0

  // yuanmm add begin

  MX6Q_PAD_CSI0_DAT12__UART4_TXD,

  MX6Q_PAD_CSI0_DAT13__UART4_RXD,

  // yuanmm add end

3, arch\arm\mach-mx6\Board-mx6q_sabresd.c

add code as follow:

static inline void mx6q_sabresd_init_uart(void)

{

  imx6q_add_imx_uart(2, NULL);

  imx6q_add_imx_uart(0, NULL);

  // yuanmm add uart begin

  imx6q_add_imx_uart(1, NULL);

  imx6q_add_imx_uart(3, NULL);

  imx6q_add_imx_uart(4, NULL);

  // yuanmm add uart end

}

4,arch\arm\mach-mx6\Board-mx6q_sabresd.c

as ppt description, I should add code

early_console_setup(UART4_BASE_ADDR, uart_clk);

but I think this functiong is for console setting, so I didn't add this code for uart4

5, arch\arm\plat-mxc\include\mach\Uncompress.h

this fill already have follow code, so I didn't modify this code

  case MACH_TYPE_MX6Q_SABRESD:

  uart_base = MX6Q_UART1_BASE_ADDR;

  break;

0 Kudos
Reply
1,944 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi mingmingyuan,

Your step is OK. Sorry for late reply. I wonder if your uart4 can work now?

Have a nice day
Dan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,943 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

OK. If any questions you can contact me easily.

0 Kudos
Reply