MPC5200,PSC in uart mode, receiving problem

Tomasz Prochownik 916 at mcd.com.pl
Mon Oct 10 21:37:12 EST 2005


Hello.
I'm beginner in ppc linux, so I believe, you can help me. I hope you'll be able to understand my english :o).

I have MPC5200Lite board with Linux from Denx (kernel 2.4.25).
I try to use PSC in UART mode to read chars from other system.

My init ttyS function:

   i_Fd = open("/dev/ttyS2", O_RDWR | O_NOCTTY |O_NDELAY);

   if (i_Fd == -1 )
   {DEBUG_OUT("[ERROR]\r\n");}
   else
   {
	 tcgetattr(i_Fd,&strBufOptions);	
	 bzero(&strOptions, sizeof(strOptions));
	 strOptions.c_cflag = Baud | CS8 |CREAD |CLOCAL;
	 strOptions.c_iflag = 0;
	 strOptions.c_oflag = 0;
	 strOptions.c_lflag = 0;
	 strOptions.c_cc[VTIME] = 0;
	 strOptions.c_cc[VMIN] 	= 0;
	 tcflush(i_Fd, TCIFLUSH);
         tcsetattr(i_Fd,TCSANOW,&strOptions);
   }


Everything works fine until first framing error (FE)  in receiver. Since then function read(i_Fd,DataBuffer,CO_MAX_BUF_LEN-1) returns number of received chars, but value of every char in DataBuffer is zero.

I have done some experiments and noticed one more strange things:

1. I use hyperterminal in 115200 baud as root console
2. If I change speed to 9600, send one char to MPC5200 (framing error?) and change speed back to 115200 -> uart blocks (there is no response in the console).
..so maybe bug isn't in my code...?
I have read in errata about blocking uart receiver(bug ID: 364) , but I don't know it can be in my application.

Best regards

-===-
Tomasz Prochownik
MCD Electronics
33 861 60 35 w. 13
916 at mcd.com.pl







More information about the Linuxppc-embedded mailing list