Hi Alexis,
Sorry for the delay, I was out of town.
I have tried the statical configuration and it seemed to work, i.e. I could
execute the example program /usr/xenomai/bin/cmd_read. However, I wanted to
run the task in real-time and added the -r option which results in
r...@xenomai:/usr/xenomai/bin# ./cmd_read -vr
cmd_read: switching to real-time mode
cmd_read: device comedi0 opened (fd=0)
cmd_read: basic descriptor retrieved
subdevices count = 14
read subdevice index = 0
write subdevice index = 1
cmd_read: complex descriptor retrieved
cmd_read: channel 0
ranges count = 7
range's size = 16 (bits)
cmd_read: channel 1
ranges count = 7
range's size = 16 (bits)
cmd_read: channel 2
ranges count = 7
range's size = 16 (bits)
cmd_read: channel 3
ranges count = 7
range's size = 16 (bits)
cmd_read: scan size = 8
cmd_read: size to read = 800
cmd_read: command successfully sent
0xff 0xff 0xff 0xff 0xff 0xff 0x81 0xf9
0xff 0xff 0xff 0xff 0xff 0xff 0xca 0xfb
...snip...
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
cmd_read: comedi_read failed (ret=-2)
The cmd_write however, seems to work
r...@xenomai:/usr/xenomai/bin# ./cmd_write -rv
cmd_write: switching to real-time mode
cmd_write: device comedi0 opened (fd=0)
cmd_write: basic descriptor retrieved
subdevices count = 14
read subdevice index = 0
write subdevice index = 1
cmd_write: complex descriptor retrieved
cmd_write: channel 0
ranges count = 3
range's size = 16 (bits)
cmd_write: channel 1
ranges count = 3
range's size = 16 (bits)
cmd_write: scan size = 4
cmd_write: size to write = 400
cmd_write: command successfully sent
cmd_write: 400 bytes successfully written
also...
r...@xenomai:/usr/xenomai/bin# ./insn_read -rv
insn_read: switching to real-time mode
insn_read: device (null) opened (fd=0)
insn_read: basic descriptor retrieved
subdevices count = 14
read subdevice index = 0
write subdevice index = 1
insn_read: complex descriptor retrieved
insn_read: channel width is 16 bits
insn_read: global scan size is 20
0xff 0xff
0x0 0x0
0xff 0xff
0x0 0x0
0xff 0xff
0x0 0x0
0xff 0xff
0x0 0x0
0xff 0xff
0x0 0x0
insn_read: 20 bytes successfully received
What I would like to make sure is that I can write to comedi0 without having
mode switches. Therefore I copied cmd_write and added a rt_task_spawn to
make sure that the task_body runs in real-time (even though the -r option
results in the same behavior.) This way, I could add/change code to check
for mode switches... However, since unfortunately I am debugging things
remotely I cannot "see" the output (the display) of our oscilloscope that is
connected to the pci express card. I'll send an email as soon as I know
more.
Besides that, I updated to your latest xenomai and re-compiled having the
comedi drivers compiled as loadable modules. After booting the new kernel I
can see the following:
xenomai:~> uname -a
Linux xenomai 2.6.30.5-xenomai-ipipe-comedi #6 SMP Wed Oct 21 20:05:37 PDT
2009 i686 GNU/Linux
xenomai:~> lspci -v
...snip...
06:00.0 Class ff00: National Instruments Device 717f
Flags: bus master, medium devsel, latency 64, IRQ 11
Memory at f7dfe000 (32-bit, non-prefetchable) [size=4K]
Memory at f7dff000 (32-bit, non-prefetchable) [size=4K]
Kernel driver in use: mite
Kernel modules: comedi_ni_pcimio
...snip...
xenomai:~> lsmod | grep come
comedi_ni_tio 26884 0
comedi_8255 4420 0
comedi_ni_mite 12708 1 comedi_ni_tio
xeno_comedi 39908 3 comedi_ni_tio,comedi_8255,comedi_ni_mite
However, the problem is that there is:
r...@xenomai:/usr/xenomai/sbin# ./comedi_config comedi0 comedi_pcimio
comedi_config: comedi_snd_attach failed ret=-22
also...
r...@xenomai:/usr/xenomai/sbin# ./comedi_config comedi0 comedi_ni_mite
comedi_config: comedi_snd_attach failed ret=-22
r...@xenomai:/usr/xenomai/sbin# dmesg
...snip...
[ 11.298460] Comedi: MITE: Available NI device IDs: 0x717f(used)
[ 11.305333] comedi_8255: module license 'unspecified' taints kernel.
[ 11.305337] Disabling lock debugging due to kernel taint
[ 11.331840] comedi_ni_mio: Unknown symbol ni_tio_handle_interrupt
[ 11.331936] comedi_ni_mio: Unknown symbol ni_tio_set_mite_channel
[ 11.331986] comedi_ni_mio: Unknown symbol ni_tio_cmd_mask
[ 11.332171] comedi_ni_mio: Unknown symbol ni_tio_init_counter
[ 11.332317] comedi_ni_mio: Unknown symbol ni_tio_winsn
[ 11.332416] comedi_ni_mio: Unknown symbol ni_gpct_device_destroy
[ 11.332466] comedi_ni_mio: Unknown symbol ni_tio_insn_config
[ 11.332696] comedi_ni_mio: Unknown symbol ni_tio_acknowledge_and_confirm
[ 11.332786] comedi_ni_mio: Unknown symbol ni_tio_cmdtest
[ 11.332921] comedi_ni_mio: Unknown symbol ni_tio_cancel
[ 11.332976] comedi_ni_mio: Unknown symbol ni_gpct_device_construct
[ 11.333139] comedi_ni_mio: Unknown symbol ni_tio_rinsn
[ 11.333189] comedi_ni_mio: Unknown symbol ni_tio_cmd
...snip...
How can I fix this ? Or should I simply work with the statical linked comedi
drivers ??
Thanks,
peter
On Mon, Oct 19, 2009 at 2:24 PM, Alexis Berlemont <[email protected]>wrote:
> Hi,
>
> On Saturday 17 October 2009 16:00:15 Alexis Berlemont wrote:
> > Hi,
> >
> > On Saturday 17 October 2009 01:48:47 Peter Pastor wrote:
> > > Hey Alexis,
> > >
> > > >> That's because you did not retrieve the "comedi" branch, you are
> > > >> working
> > >
> > > the
> > >
> > > >> master branch which is left unused.
> > > >> You should create a branch on your local repository with the remote
> > >
> > > comedi
> > >
> > > >> branch as reference.
> > >
> > > Sorry... I managed to do it :) (I am new to git) However, I could not
> > > compile the kernel :(
> > >
> > > drivers/xenomai/comedi/intel/8255.c:50:47: error: macro
> > > "subdev_8255_interrupt" requires 2 arguments, but only 1 given
> > > drivers/xenomai/comedi/intel/8255.c:51: error: expected ‘=’, ‘,’, ‘;’,
> > > ‘asm’ or ‘__attribute__’ before ‘{’ token
> > > drivers/xenomai/comedi/intel/8255.c: In function ‘do_config’:
> > > drivers/xenomai/comedi/intel/8255.c:85: error: ‘CR_CW’ undeclared
> (first
> > > use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:85: error: (Each undeclared
> > > identifier is reported only once
> > > drivers/xenomai/comedi/intel/8255.c:85: error: for each function it
> > > appears in.)
> > > drivers/xenomai/comedi/intel/8255.c:88: error: ‘CR_A_IO’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:90: error: ‘CR_B_IO’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:92: error: ‘CR_C_LO_IO’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:94: error: ‘CR_C_HI_IO’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:95: error: ‘_8255_CR’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c: In function ‘subd_8255_insn_bits’:
> > > drivers/xenomai/comedi/intel/8255.c:146: error: ‘_8255_DATA’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:204:42: error: macro
> > > "subdev_8255_init" requires 2 arguments, but only 1 given
> > > drivers/xenomai/comedi/intel/8255.c: At top level:
> > > drivers/xenomai/comedi/intel/8255.c:205: error: expected ‘=’, ‘,’, ‘;’,
> > > ‘asm’ or ‘__attribute__’ before ‘{’ token
> > > drivers/xenomai/comedi/intel/8255.c: In function ‘dev_8255_attach’:
> > > drivers/xenomai/comedi/intel/8255.c:274: error: ‘_8255_SIZE’ undeclared
> > > (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c:282:25: error: macro
> > > "subdev_8255_init" requires 2 arguments, but only 1 given
> > > drivers/xenomai/comedi/intel/8255.c:282: error: ‘subdev_8255_init’
> > > undeclared (first use in this function)
> > > drivers/xenomai/comedi/intel/8255.c: In function ‘dev_8255_detach’:
> > > drivers/xenomai/comedi/intel/8255.c:306: error: ‘_8255_SIZE’ undeclared
> > > (first use in this function)
> > > make[4]: *** [drivers/xenomai/comedi/intel/8255.o] Error 1
> > > make[3]: *** [drivers/xenomai/comedi/intel] Error 2
> > > make[2]: *** [drivers/xenomai/comedi] Error 2
> > > make[1]: *** [drivers/xenomai] Error 2
> > > make: *** [drivers] Error 2
> >
> > My fault. I forgot to handle some pre-compilation constants when the
> > drivers are compiled as modules.
> >
> > I will update my git repository; meanwhile, you can statically link all
> the
> > comedi drivers into the kernel. That is a temporary solution until the
> fix
> > is available.
>
> I updated the git repository a few hours after my answer to your last mail.
> Did you have any opportunity to test it ? Or did you test a statical
> configuration ?
>
> Many thanks.
>
> > > When I reconfigure the kernel to not compile 8255 and friends it does
> not
> > > compile either...
> > >
> > > ... snip ...
> > > AS arch/x86/boot/header.o
> > > LD arch/x86/boot/setup.elf
> > > OBJCOPY arch/x86/boot/setup.bin
> > > BUILD arch/x86/boot/bzImage
> > > Root device is (8, 1)
> > > Setup is 11692 bytes (padded to 11776 bytes).
> > > System is 2347 kB
> > > CRC 84c0200
> > > Kernel: arch/x86/boot/bzImage is ready (#1)
> > > ERROR: "comedi_alloc_subd"
> > > [drivers/xenomai/comedi/testing/comedi_loop.ko] undefined!
> > > ERROR: "comedi_alloc_subd"
> > > [drivers/xenomai/comedi/testing/comedi_fake.ko] undefined!
> > > make[1]: *** [__modpost] Error 1
> > > make: *** [modules] Error 2
> > >
> > > I tried 2.6.31 and 2.6.30.5.
> >
> > Another bug of mine. The EXPORT_SYMBOL was missing.
> >
> > Once more, with a kernel in which the drivers are statically included,
> you
> > won't face this issue anymore.
> >
> > > I really appreciate your help !
> > >
> > > Thanks,
> > > peter
> >
> Alexis.
>
>
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help