[uClinux-dev] slow UART on MCF 5272?

Magnusson, Johan johan.magnusson at sd.teleca.se
Wed Nov 14 11:24:58 EST 2001

Hi all!

I'm new to this list (not as a reader but anyway..). I have been working
with the uClinux distribution for MCF5272 for two weeks now and it has been
working pretty good, except from some problems using the second UART. So
what would you expect? yet another UART problem? of course!

I am having troubles running this UART in 115200. 9600 works fine but 115200
is VERY shaky, 38400 works but i don't get the speed I am asking for. This
feels like a problem induced by my UART initialization.

So here is what I do:

in mcfserial.c i do according to previous mails on the list from Greg
Ungerer i add:

>        /* Enable the output lines for the serial ports */ 
>        portp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PBCNT); 
>        *portp = (*portp & ~0x000000ff) | 0x00000055; 
>        portp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PDCNT); 
>        *portp = (*portp & ~0x000003fc) | 0x000002a8; 


I then initialize my serial port from my program using:

>  cfmakeraw(&t);
>  t.c_cflag &= ~CBAUD;
>  t.c_cflag |= B115200 | CS8 | CLOCAL;
>  t.c_oflag = 0; /* turn off output processing */
>  t.c_lflag = 0; /* no local modes */
>  t.c_cflag |= CRTSCTS;
> if (tcsetattr(fd, TCSANOW, &t) < 0)
>  {
>    perror("fd_setup : tcsetattr");
>    exit(1);
>  }


This results in my cellular phone (Ericsson t39) not getting my "message".
speeds under 38400 works fine but higher speeds do not work. Ohh it works
from my PC but not from my embedded system.

I have tried a couple of arguments for the serial port set-up without any
effect on the result. I also noticed someone pointing out a rounding problem
(in mcfserial.c) in setting the speed registry bits (integer division to
integer). I implemented the proposed solution, without any luck.
what am I doing wrong here?? This have to be some silly initialization
problem, but I am obviously not good enough to fix it!

Best regards
Johan K Magnusson
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/

More information about the uClinux-dev mailing list