UART in RTEMS
Joris van Rantwijk
jorisvr at sron.nl
Wed Aug 11 17:28:20 UTC 2010
On Wednesday 11 August 2010 18:50:18 João Rasta wrote:
> I'm using a LEON3 architecture with RTEMS. I can successfully open() the
> UART device but i'm having transmission errors (erroneous packet data).
> Accoording to rtems gaisler drivers doc rtems-gaisler-drivers-1.0.2.pdf i
> need to register the driver with apbuart_register(&amba_conf) prior to start
> TX/RX as well as to configure the driver with ioctl(), but i'm not sure. I
> have checked that the baud rate is correclty set.
I have only a little experience with the APBUART driver in RTEMS.
It seemed to work fine, but the interface not so nice.
To use it, I did something like:
fd = open("/dev/apbuart1", O_RDWR);
ioctl(fd, APBUART_SET_BAUDRATE, 38400);
ioctl(fd, APBUART_START, NULL);
> Do i need to use such functions to get the UART working properly? Or open()
> and cfsetospeed() for baudrate set are enough?
cfsetospeed() has no effect, you need to use the ioctl().
I'm unhappy that the driver does not use the standard termios interface.
Also the call to apbuart_register() kills my stdin/stdout console.
Also the driver works only with APBUART firmware cores that have a FIFO.
We eventually designed a new APBUART driver, using the termios framework.
If you like, I can send you our driver and you can give it a try.
Greetings, Joris van Rantwijk.
More information about the users