Xenomai RTSerial

From wiki.emacinc.com
Revision as of 18:14, 3 March 2016 by Mwelling (talk | contribs)
Jump to: navigation, search
TODO: {{#todo: NotStarted (03.03.2016-13:01->MW+)|Michael Welling|OE 5.0,MW,NotStarted}}

General Information

Xenomai provides a RTDM profile for serial device drivers enabling real-time UART serial communication. The RTDM serial driver provides the necessary user-space API to perform serial port configuration and communication. The following sections will outline the use of the user-space interface and provide basic examples.

Xenomai RTSerial

Given the RTDM serial port driver exist and is loaded for the target on hand, it will provide a device nodes at /dev/rtdm/rtserX where X is replaced by the number of the port. This device node is then accessed to configured and communicate using the underlying port. The following sections with outline loading the driver, configuring the port, and performing basic serial transactions.

Loading the driver

Typically there will be a Linux kernel driver associated with the port. If desired device is associated with a Linux driver the driver must be unloaded or the device must be unbound from the driver. Below are examples of loading the RTDM driver for some supported targets.

x86 16550A

iMX6 rt_imx_uart

Configuring the serial port

Performing serial transactions


Xenomai provides an example called cross-link which provides an easy way to test serial ports. Essentially the demo send data from one serial port and receives it on another. To run the demo make sure the RTDM driver is load and connect the first two port via a NULL modem cable.

root@somimx6-xenomai:~# /usr/demo/cross-link
main : write-file opened
main : write-config written
main : read-file openedmain : read-config written
main : write-task createdmain : read-task created
main : starting write-task
main : starting read-task
 Nr |   write->irq    |    irq->read    |   write->read   |
  0 |18446744041591572624 |     32118717325 |          738333
  1 |18446744041591563290 |     32118715326 |          727000
  2 |18446744041591563957 |     32118716326 |          728667
  3 |18446744041591561291 |     32118714658 |          724333
  4 |18446744041591562624 |     32118715992 |          727000
  5 |18446744041591560290 |     32118715326 |          724000


Further Information

Where to Go Next
Pages with Related Content