Re: [Xenomai-help] Xenomai 2.6.0-rc4

2011-09-29 Thread Philippe Gerum
On Wed, 2011-09-28 at 20:34 +0200, Gilles Chanteperdrix wrote:
> Hi, 
> 
> here is the 4th release candidate for Xenomai 2.6.0:
> http://download.gna.org/xenomai/testing/xenomai-2.6.0-rc4.tar.bz2
> 
> Novelties since -rc3 include:
> - a fix for the "long names" issue on psos+
> - a fix for the build issue of mscan on mpc52xx (please Wolfgang, have 
> a look at the patch, to see if you like it:)
> http://git.xenomai.org/?p=xenomai-head.git;a=commitdiff;h=d22fd231db7eb0af8e77ec570efb89e578e13781;hp=4a2188f049e96fc59aa7c4a7a9d058075f3d79e8
> - a new version of the I-pipe patch for linux 3.0 on ppc.

People running 2.13-02/powerpc over linux 3.0.4 should definitely
upgrade to 2.13-03, or apply this:
http://git.denx.de/?p=ipipe-2.6.git;a=commit;h=7c28eb2dea86366bf721663bb8d28ce89cf2806c

> 
> This should be the last release candidate.
> 
> Regards.
> 

-- 
Philippe.



___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Command code working with comedi not working with analogy

2011-09-29 Thread Fernando Herrero Carrón
El 28 de septiembre de 2011 12:19, Fernando Herrero Carrón <
elfe...@gmail.com> escribió:

> 2011/9/28 Julien Delange 
>
>> 2011/9/27 Fernando Herrero Carrón :
>> > [snip]
>>
>> Dear Fernando,
>>
>> Would it be possible to provide more information about your bug, in
>> particular, the configuration of the board (which is analogy0, ...)
>> and the code you are trying to use ?
>>
>> Also, as Gilles said, please also try the latest rc release, it might
>> solve your issues.
>>
>> Thanks,
>>
>
> Dear Gilles and Julien,
>
> Thanks for your replies. I will try the latest RC and let you know.
>
> These are the details of my setup:
>
> - Dmesg output:
>
>  Analogy: MITE: Available NI device IDs: 0x1870 0x70c0
>
> - lspci:
> 01:05.0 Class ff00: National Instruments Device 70c0 (this should be the NI
> 6143) <- used for AO
> 01:06.0 Class ff00: National Instruments PCI-6713 <- used for AI
>
> - analogy-config:
> /usr/xenomai/sbin/analogy_config  analogy0 analogy_ni_pcimio 1,5
> /usr/xenomai/sbin/analogy_config  analogy1 analogy_ni_pcimio 1,6
>
> - cat /proc/analogy/devices
> --  Analogy devices --
>
> | idx | status | driver
> |  00 | Linked | analogy_ni_pcimio
> |  01 | Linked | analogy_ni_pcimio
> |  02 | Unused | No driver
> [...]
>
> - cat /proc/analogy/00-analogy_ni_pcimio
> --  Subdevices --
>
> | idx | type
> |  00 | Analog input subdevice
> |  01 | Unused subdevice
> |  02 | Digital input/output subdevice
> |  03 | Unused subdevice
> |  04 | Unused subdevice
> |  05 | Calibration subdevice
> |  06 | Memory subdevice
> |  07 | Digital input/output subdevice
> |  08 | Unused subdevice
> |  09 | Serial subdevice
> |  10 | Unused subdevice
> |  11 | Counter subdevice
> |  12 | Counter subdevice
> |  13 | Counter subdevice
>
> - cat /proc/analogy/01-analogy_ni_pcimio
> --  Subdevices --
>
> | idx | type
> |  00 | Unused subdevice
> |  01 | Analog output subdevice
> |  02 | Digital input/output subdevice
> |  03 | Unused subdevice
> |  04 | Unused subdevice
> |  05 | Calibration subdevice
> |  06 | Memory subdevice
> |  07 | Digital input/output subdevice
> |  08 | Unused subdevice
> |  09 | Serial subdevice
> |  10 | Unused subdevice
> |  11 | Counter subdevice
> |  12 | Counter subdevice
> |  13 | Counter subdevice
>
> Thanks,
> Fernando
>

Dear all,

I have followed your advice and just tested with the following
kernel/xenomai versions:

Linux  2.6.38.8-xenomai-2.6rc4 #1 SMP PREEMPT Thu Sep 29 16:17:41
BRT 2011 x86_64 GNU/Linux

Now both "cmd_read" and my own code are running, but "a4l_async_read" reads
either garbage or either value of 0 or 0x8000. In order to make cmd_read
work with my board I had to make the following changes to the code:

--- cmd_read.c.orig2011-09-29 16:40:50.0 -0300
+++ cmd_read.c2011-09-29 16:41:04.0 -0300
@@ -66,8 +66,8 @@
 .start_arg = 0,
 .scan_begin_src = TRIG_TIMER,
 .scan_begin_arg = 800,/* in ns */
-.convert_src = TRIG_TIMER,
-.convert_arg = 50,/* in ns */
+.convert_src = TRIG_NOW,
+.convert_arg = 0,/* in ns */
 .scan_end_src = TRIG_COUNT,
 .scan_end_arg = 0,
 .stop_src = TRIG_COUNT,

otherwise the drive would complain about "the driver cmd_test failed" or
something like that, because my board has 8 parallel ADCs.

If I run my program (see attachment) and call dmesg I can see:

[  641.237710] Analogy: analogy_ni_pcimio: ni_ai_cmd: start
[  641.237718] Analogy: analogy_ni_pcimio: ni_ai_cmd:
Interrupt_A_Enable_Register = 0x0031
[  641.237723] Analogy: analogy_ni_pcimio: ni_ai_cmd: exit
[  641.238874] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
a_status=90b0 ai_mite_status=0020
[  641.239872] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
a_status=9030 ai_mite_status=0020
[...]
[  642.237879] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
a_status=9070 ai_mite_status=0020
[  642.237881] Analogy: analogy_ni_pcimio: ni_mio_common: SC_TC interrupt

I just checked my setup with our RTAI/comedi code and it is properly
working. The input card is attached to a 3Hz sine wave generator with 1V
peek-to-peek. If I run the attached program, the output looks like this:

Analogy device analogy_ni_pcimio.
Channel 0 has 16 bits and 1 different ranges
32768
32768
32768
32768
32768
[...]
32768

Any help on debugging this would be greatly appreciated.

Sincerely,
Fernando
/**
 * Use analogy commands to read an analog device.
 */
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 

#include 

#define NICHAN   1
#define INPUT_FREQ 1000

a4l_desc_t dev_input;

a4l_chinfo_t *chaninfos[NICHAN] = {0};

static lsampl_t maxdatai;

int ret = 0;

#define SAMPLE_HISTORY 1000
long unsigned int channel_history[SAMPLE_HISTORY][NICHAN] = {0};

RT_TASK rt_task_desc;

int init_board(void)
{
	int result = 0;

	result = a4l_open(&dev_input, "analogy0");
	printf("Analogy device %s.\n", dev_input.board_name);

	if (

Re: [Xenomai-help] Command code working with comedi not working with analogy

2011-09-29 Thread Alexis Berlemont
Hi,

2011/9/29 Fernando Herrero Carrón :
> El 28 de septiembre de 2011 12:19, Fernando Herrero Carrón
>  escribió:
>>
>> 2011/9/28 Julien Delange 
>>>
>>> 2011/9/27 Fernando Herrero Carrón :
>>> > [snip]
>>>
>>> Dear Fernando,
>>>
>>> Would it be possible to provide more information about your bug, in
>>> particular, the configuration of the board (which is analogy0, ...)
>>> and the code you are trying to use ?
>>>
>>> Also, as Gilles said, please also try the latest rc release, it might
>>> solve your issues.
>>>
>>> Thanks,
>>
>> Dear Gilles and Julien,
>>
>> Thanks for your replies. I will try the latest RC and let you know.
>>
>> These are the details of my setup:
>>
>> - Dmesg output:
>>
>>  Analogy: MITE: Available NI device IDs: 0x1870 0x70c0
>>
>> - lspci:
>> 01:05.0 Class ff00: National Instruments Device 70c0 (this should be the
>> NI 6143) <- used for AO
>> 01:06.0 Class ff00: National Instruments PCI-6713 <- used for AI
>>
>> - analogy-config:
>> /usr/xenomai/sbin/analogy_config  analogy0 analogy_ni_pcimio 1,5
>> /usr/xenomai/sbin/analogy_config  analogy1 analogy_ni_pcimio 1,6
>>
>> - cat /proc/analogy/devices
>> --  Analogy devices --
>>
>> | idx | status | driver
>> |  00 | Linked | analogy_ni_pcimio
>> |  01 | Linked | analogy_ni_pcimio
>> |  02 | Unused | No driver
>> [...]
>>
>> - cat /proc/analogy/00-analogy_ni_pcimio
>> --  Subdevices --
>>
>> | idx | type
>> |  00 | Analog input subdevice
>> |  01 | Unused subdevice
>> |  02 | Digital input/output subdevice
>> |  03 | Unused subdevice
>> |  04 | Unused subdevice
>> |  05 | Calibration subdevice
>> |  06 | Memory subdevice
>> |  07 | Digital input/output subdevice
>> |  08 | Unused subdevice
>> |  09 | Serial subdevice
>> |  10 | Unused subdevice
>> |  11 | Counter subdevice
>> |  12 | Counter subdevice
>> |  13 | Counter subdevice
>>
>> - cat /proc/analogy/01-analogy_ni_pcimio
>> --  Subdevices --
>>
>> | idx | type
>> |  00 | Unused subdevice
>> |  01 | Analog output subdevice
>> |  02 | Digital input/output subdevice
>> |  03 | Unused subdevice
>> |  04 | Unused subdevice
>> |  05 | Calibration subdevice
>> |  06 | Memory subdevice
>> |  07 | Digital input/output subdevice
>> |  08 | Unused subdevice
>> |  09 | Serial subdevice
>> |  10 | Unused subdevice
>> |  11 | Counter subdevice
>> |  12 | Counter subdevice
>> |  13 | Counter subdevice
>>
>> Thanks,
>> Fernando
>
> Dear all,
>
> I have followed your advice and just tested with the following
> kernel/xenomai versions:
>
> Linux  2.6.38.8-xenomai-2.6rc4 #1 SMP PREEMPT Thu Sep 29 16:17:41
> BRT 2011 x86_64 GNU/Linux
>
> Now both "cmd_read" and my own code are running, but "a4l_async_read" reads
> either garbage or either value of 0 or 0x8000. In order to make cmd_read
> work with my board I had to make the following changes to the code:
>
> --- cmd_read.c.orig    2011-09-29 16:40:50.0 -0300
> +++ cmd_read.c    2011-09-29 16:41:04.0 -0300
> @@ -66,8 +66,8 @@
>  .start_arg = 0,
>  .scan_begin_src = TRIG_TIMER,
>  .scan_begin_arg = 800,    /* in ns */
> -    .convert_src = TRIG_TIMER,
> -    .convert_arg = 50,    /* in ns */
> +    .convert_src = TRIG_NOW,
> +    .convert_arg = 0,    /* in ns */
>  .scan_end_src = TRIG_COUNT,
>  .scan_end_arg = 0,
>  .stop_src = TRIG_COUNT,
>
> otherwise the drive would complain about "the driver cmd_test failed" or
> something like that, because my board has 8 parallel ADCs.
>
> If I run my program (see attachment) and call dmesg I can see:
>
> [  641.237710] Analogy: analogy_ni_pcimio: ni_ai_cmd: start
> [  641.237718] Analogy: analogy_ni_pcimio: ni_ai_cmd:
> Interrupt_A_Enable_Register = 0x0031
> [  641.237723] Analogy: analogy_ni_pcimio: ni_ai_cmd: exit
> [  641.238874] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
> a_status=90b0 ai_mite_status=0020
> [  641.239872] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
> a_status=9030 ai_mite_status=0020
> [...]
> [  642.237879] Analogy: analogy_ni_pcimio: ni_mio_common: interrupt:
> a_status=9070 ai_mite_status=0020
> [  642.237881] Analogy: analogy_ni_pcimio: ni_mio_common: SC_TC interrupt
>
> I just checked my setup with our RTAI/comedi code and it is properly
> working. The input card is attached to a 3Hz sine wave generator with 1V
> peek-to-peek. If I run the attached program, the output looks like this:
>
> Analogy device analogy_ni_pcimio.
> Channel 0 has 16 bits and 1 different ranges
> 32768
> 32768
> 32768
> 32768
> 32768
> [...]
> 32768
>
> Any help on debugging this would be greatly appreciated.

With insn_read, did you manage to acquire correct values at least?

>
> Sincerely,
> Fernando
>
> ___
> Xenomai-help mailing list
> Xenomai-help@gna.org
> https://mail.gna.org/listinfo/xenomai-help
>
>

Alexis.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help