Re: ni 6220 m and comedi_soft_calibrate

On Thursday 28 September 2006 12:53 pm, Jon Weisz wrote:
> I finally got comedi_soft_config to compile after some problems with
> libstdc++ versions being different, but now Comedi_soft_calibrate fails
> with this output:
>         estimate of mean = 65535
>         estimate of standard deviation = 0
>         estimate of standard deviation of mean = 0
> comedi_soft_calibrate: ni_m_series_calibrator.cpp:592: unsigned int
> NIMSeries::References::getMinSamplePeriodNanosec() const: Assertion
> `retval == 0 || retval >=3' failed.

That looks odd, since it seems it is aborting in 
NIMSeries::Calibrator::characterizePWM() in the 
getMinSamplePeriodNanosec() call.  But it looks like it makes it though 
the loop once, so getMinSamplePeriodNanosec() must succeed at least once 
before failing.  Maybe some memory is getting corrupted in the first pass 
through the loop?  Valgrind gives a lot of warnings when I run 
comedi_soft_calibrate through it (most of which are probably bogus) but it 
wouldn't hurt to make comedilib valgrind-clean.

The other secondary problem is the reading of 65535 is saturated, which 
might indicate that the input range is not getting set correctly.  You 
might try doing some simple readings with comedilib/demo/inp to see if you 
get anything reasonable.

For reference, I've attached the output of a successful run with a 6289.

>
> dmesg shows this:
>  m_series_stc_readw: bug! unhandled register=0x7 in switch.
>
> also of note in dmesg:
>
> [17194230.332000]  ( irq = 209 )m_series_stc_writew: FIXME: register 0xb
> does not map cleanly on to m-series boards.[17194230.332000]
> m_series_stc_writew: bug! unhandled register=0x3a in switch.
> [17194230.332000] m_series_stc_writew: bug! unhandled register=0x4f in
> switch.
> [17194230.336000] m_series_stc_writew: bug! unhandled register=0x50 in
> switch.
> [17194230.336000]
>
> If noone has time to fix the driver  but can advise me as to what needs
> looking in to, I'd be glad to give it a try.

The warnings about the registers are to be expected, they shouldn't cause a 
problem for calibration.  They happen for me too with the 6289.  

If you want to look into the problem you are seeing yourself, the idea is 
that getMinSamplePeriodNanosec() is calling comedi_command_test() to find 
out what the fastest sampling rate of your board is.  
comedi_command_test() eventually calls ni_ai_cmdtest() in 
comedi/drivers/ni_mio_common.c which is supposed to fix up the 
scan_begin_arg of the command in "step 4" and return 4.
 
-- 
Frank

Received on 2006-10-02Z01:50:34