imx6ull uart3 (ttymxc2) read problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx6ull uart3 (ttymxc2) read problem

ソリューションへジャンプ
1,548件の閲覧回数
alampret
Contributor I

Hello,

I'm facing a problem on reading on uart3 at my custom imx6ull board.

An stm32 is connected to uart3 (ttymxc2).

Writing and reading firmware with stm32flash -w and -r works fine. But custom program does not work.

This is the initialisation, this works fine:

fuart = open ( dev, O_RDWR | O_NOCTTY | O_NDELAY );
if ( fuart == -1 ) {
  perror ("Cannot open Uart Interface\n");
  exit ( 1 );
}
// config UART
tcgetattr   ( fuart, &ntermios );
cfmakeraw   ( &ntermios );
cfsetispeed ( &ntermios, UARTSPEED );
cfsetospeed ( &ntermios, UARTSPEED );
 
if ( tcsetattr ( fuart, TCSANOW, &ntermios ) < 0 ) {
  perror ( "Cannot config Uart Interface\n" );
  close ( fuart );
  exit ( 1 );
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

uartRead function:

void uartRead() {
  unsigned char    buffer [ 2 * MAXPACKETSIZE ];
  int              ret, i;
  ret = read (fuart, buffer, 2 * MAXPACKETSIZE);
  printf("Read from UART: %d, %s", ret, buffer);
  if ( ret > 0 ) {
    buffer [ ret ] = 0;
    for ( i = 0; i < ret; ++i )
      uartDecode ( buffer [ i ] );
  } else {
    printf("Error: %d,%s", errno, strerror(errno));
  }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

uartRead always shows:

Read from UART: -1, nError: 11,Resource temporarily unavailable

uartRead is called after uartWrite and usleep(30000);

Exact same program works on imx6ul 14x14 evk with /dev/ttymxc1.

Device tree for uart3 on my custom board is similar to uart2 on imx6ul-14x14-evk

Have I missed anything?

Thx,

Alexander

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 解決策
1,009件の閲覧回数
diegoadrian
NXP Employee
NXP Employee

Hello Alexander,

Can you please try to use the UART of the i.MX6 without the ST34.

Try connecting the Tx of the i.MX6 with his own Rx, and see if your are getting any log data.

Best Regards,

Diego.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,010件の閲覧回数
diegoadrian
NXP Employee
NXP Employee

Hello Alexander,

Can you please try to use the UART of the i.MX6 without the ST34.

Try connecting the Tx of the i.MX6 with his own Rx, and see if your are getting any log data.

Best Regards,

Diego.

0 件の賞賛
返信
1,009件の閲覧回数
alampret
Contributor I

Thank you for the hint.

Loopback test worked fine. It was a flashing issue of stm32.

 

Now it works well!

 

Best regards,

Alexander

0 件の賞賛
返信