Termios not setting baud rate in LEON3

Mohammed Saeed Khoory Mohammed.Khoory at eiast.ae
Wed Nov 26 07:11:14 UTC 2014


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.

Mohammed Khoory

More information about the users mailing list