Termios not setting baud rate in LEON3

Mohammed Saeed Khoory Mohammed.Khoory at eiast.ae
Wed Nov 26 08:35:46 UTC 2014


I tried setting the breakpoint, but GDB couldn't find the symbol.

I decided to step through the tcsetattr(), and I eventually reached the following lines in termios.c (lines 577, 588)

if (tty->device.setAttributes)
	(*tty->device.setAttributes)(tty->minor, &tty->termios);


tty->device.setAttributes was set to 0, so the code inside the if statement was skipped. I think this was the cause of the problem.

I forgot to mention that I'm using RTEMS 4.10.2. This may have been fixed in 4.11? 

In any case, I decided to work around this by manually setting the scaler register in the UART once again.

> -----Original Message-----
> From: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
> Sent: Wednesday, November 26, 2014 4:21 PM
> To: Mohammed Saeed Khoory; rtems-users at rtems.org
> Subject: Re: Termios not setting baud rate in LEON3
> 
> Hello Mohammed,
> 
> can you set a break point in apbuart_set_attributes() and see what
> happens?  This should set the baud.
> 
> On 26/11/14 08:11, Mohammed Saeed Khoory wrote:
> > Hi,
> >
> > I'm having a few issues setting the baud rate of the second UART on
> LEON3 to 115200 via termios.
> >
> > - I've opened the second UART using open() and "/dev/console_b" as the
> path. Sending data via this UART using the fd at this stage works provided
> that the terminal on the other end is set to 38400 (the default baud
> rate). This shows that the UART is working fine.
> > - I was able to set the baud rate successfully (no errors) using
> tcgetattr(), cfsetispeed(), cfospeed(), and tcsetattr() with a baud value
> of B115200. After setting the termios structure, I used tcgetattr() again
> to confirm that it was set, and it is.
> > - After setting the baud, I changed the baud rate of the terminal on the
> other end (a Windows desktop) to 115200, then tried to send a few
> characters from the LEON3 side. I only get garbage on the other end, which
> means that there's a baud rate mismatch.
> > - If I set the other end to 38400, and try to send some characters after
> setting the baud rate to 115200, those characters show up perfectly fine.
> So it would seem that the baud rate of the UART on the LEON3 was not set
> correctly.
> >
> > I was able to set the UART to 115200 earlier by manually setting the
> UART registers, which means that the UART on the LEON3 definitely supports
> the speed.  However this is pretty ugly and I wanted to use termios
> instead.
> >
> > Does this mean that termios is not supported for LEON3 targets? Or am I
> doing something wrong? I would appreciate any help.
> >
> > Thanks,
> > Mohammed Khoory
> >
> >
> > _______________________________________________
> > users mailing list
> > users at rtems.org
> > http://lists.rtems.org/mailman/listinfo/users
> 
> --
> Sebastian Huber, embedded brains GmbH
> 
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
> 
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list