Skip to contentSkip to conversation

rtser not showing up

Xenomai-help Brandt Erickson 3 participants 6 messages May 8, 2007 – May 9, 2007

lore
Share & tools
lore
#0 lore raw

Hi,
I'm trying to get realtime communication over the serial port to work using the example found here

http://www.captain.at/xenomai-serial-port-example.php

I compiled a 2.6.20-6 kernel with xenomai-2.3.1 and configure the realtime serial driver to be a loadable module. I disabled the default linux serial driver using 'setserial'. However, when I run

	modprobe xeno_16550A ioaddr=0x3f8 irq=4
or
	insmod ./xeno16550A.ko ioaddr=0x3f8 irq=4

no rtser<N> nodes turn up in /dev. No errors are generated when I insert the module and an lsmod reveals it is in. Have I missed something? Thanks.
-Brandt

#1 lore raw
Quoted 10 lines · Brandt Erickson

Hi,
I'm trying to get realtime communication over the serial port to work using the example found here

http://www.captain.at/xenomai-serial-port-example.php

I compiled a 2.6.20-6 kernel with xenomai-2.3.1 and configure the realtime serial driver to be a loadable module. I disabled the default linux serial driver using 'setserial'. However, when I run

Quoted 8 lines
	modprobe xeno_16550A ioaddr=0x3f8 irq=4
or
	insmod ./xeno16550A.ko ioaddr=0x3f8 irq=4

no rtser<N> nodes turn up in /dev. No errors are generated when I insert the module and an lsmod reveals it is in. Have I missed something? Thanks.
-Brandt

No node will turn up in /dev, you will find the list of available RTDM devices in /proc/xenomai/rtdm/named_devices.

Signature · 1 line
					    Gilles Chanteperdrix.
#2 lore raw
Quoted 3 lines

No node will turn up in /dev, you will find the list of available RTDM devices in /proc/xenomai/rtdm/named_devices.

Okay,
there is a /proc/xenomai/rtdm/rtser0. The example opens the file "rtser0", does this default to the full path name when I use rt_dev_open?

Right now, it appears I can open the file (rt_dev_open returns 0) and configure the serial port (using rt_dev_ioctl), however, every call to rt_dev_write returns -1. I'm using the configuration from the example code which basically has everything set to defaults. Is there an equivalent of errno I can get to find out what's going wrong? Thanks. -Brandt

#3 lore raw
Quoted 7 lines

Right now, it appears I can open the file (rt_dev_open returns 0) and configure the serial port (using rt_dev_ioctl), however, every call to rt_dev_write returns -1. I'm using the configuration from the example code which basically has everything set to defaults. Is there an equivalent of errno I can get to find out what's going wrong? Thanks. -Brandt

Slight modification here, it does write correctly if I call rt_dev_write from a task spawned by main, but not if I call it from main itself. So I guess this is less about rtser per se and more about the rtdm API.

#4 lore raw
In reply to Brandt Erickson
Quoted 9 lines · Brandt Erickson
Quoted 3 lines

No node will turn up in /dev, you will find the list of available RTDM devices in /proc/xenomai/rtdm/named_devices.

Okay,
there is a /proc/xenomai/rtdm/rtser0. The example opens the file "rtser0", does this default to the full path name when I use rt_dev_open?

Quoted 6 lines

Right now, it appears I can open the file (rt_dev_open returns 0) and configure the serial port (using rt_dev_ioctl), however, every call to rt_dev_write returns -1. I'm using the configuration from the example code which basically has everything set to defaults. Is there an equivalent of errno I can get to find out what's going wrong? Thanks. -Brandt

The errors of the serial driver are documented here:

http://www.xenomai.org/documentation/trunk/html/api/group__rtserial.html

-1 is -EPERM... which is not documented. -EPERM probably means that you are trying to use a real-time call from a non real-time thread. See rt_task_shadow or rt_task_create.

Signature · 1 line
					    Gilles Chanteperdrix.
#5 lore raw
Quoted 17 lines · Gilles Chanteperdrix
Quoted 9 lines · Brandt Erickson
Quoted 3 lines

No node will turn up in /dev, you will find the list of available RTDM devices in /proc/xenomai/rtdm/named_devices.

Okay,
there is a /proc/xenomai/rtdm/rtser0. The example opens the file "rtser0", does this default to the full path name when I use rt_dev_open?

Quoted 6 lines

Right now, it appears I can open the file (rt_dev_open returns 0) and configure the serial port (using rt_dev_ioctl), however, every call to rt_dev_write returns -1. I'm using the configuration from the example code which basically has everything set to defaults. Is there an equivalent of errno I can get to find out what's going wrong? Thanks. -Brandt

Quoted 8 lines

The errors of the serial driver are documented here:

http://www.xenomai.org/documentation/trunk/html/api/group__rtserial.html

-1 is -EPERM... which is not documented. -EPERM probably means that you are trying to use a real-time call from a non real-time thread. See rt_task_shadow or rt_task_create.

That's the point. The serial driver's write operation requires real-time context and return -EPERM otherwise. Documentation should be enhanced...

Jan