Bug 1188 - DSLogic triggering appears to be broken
Summary: DSLogic triggering appears to be broken
Status: RESOLVED FIXED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Driver: dreamsourcelab-dslogic (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-03 13:34 CEST by Uwe Hermann
Modified: 2018-06-16 19:53 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Hermann 2018-05-03 13:34:38 CEST
Tested with DSLogic and DSLogic Basic and Plus.

The condition here seems to never trigger (so no SR_DF_TRIGGER is ever sent), needs to be investigated.

https://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=src/hardware/dreamsourcelab-dslogic/protocol.c;h=0f171518125c5aa320ba0791de3a875df182f8d9;hb=HEAD#l849
Comment 1 Jörg 2018-05-28 11:43:34 CEST
devc-> trigger_pos makes trouble. Its value is constantly in the query 1431655765.
Which equals the output (-l 5) tpos real_pos 1431655765 ram_saddr 95 cnt 865280. (Only there is devc-> trigger_pos set / outside of this if-function)
From the sources:
if (devc-> trigger_pos> devc-> sent_samples
         && devc-> trigger_pos <= devc-> sent_samples + num_samples) {
a value in the range of approx. 0 ... 2 * num_samples is expected. Thus, the 2nd Part never come true.

You might think it could never have worked that way.
Comment 2 Jörg 2018-05-30 12:28:23 CEST
1431655765 is
5555 5555 (16)
0101 0101 0101 0101 0101 0101 0101 0101 (2)

a very special value. What does that mean ?

mymistake
range for devc-> trigger_pos:   1*num_samples .... 2*num_samples.
Comment 3 Jörg 2018-05-31 23:01:31 CEST
(In reply to Jörg from comment #2)
> 1431655765 is
> 5555 5555 (16)
> 0101 0101 0101 0101 0101 0101 0101 0101 (2)
> 
> a very special value. What does that mean ?
> 
> mymistake
> range for devc-> trigger_pos:   1*num_samples .... 2*num_samples.

Change protocol.c line 1025
 devc-> trigger_pos = tpos-> ram_saddr + 1;
 Use of real_pos in the original doubtful see commit!
 Looks good with me at sigrok-cli, with PV problems.
 Please verify the trigger point with several defined signals.
Comment 4 Jörg 2018-06-05 23:24:55 CEST
(In reply to Jörg from comment #3)
> (In reply to Jörg from comment #2)
> > 1431655765 is
> > 5555 5555 (16)
> > 0101 0101 0101 0101 0101 0101 0101 0101 (2)
> > 
> > a very special value. What does that mean ?
> > 
> > mymistake
> > range for devc-> trigger_pos:   1*num_samples .... 2*num_samples.
> 
> Change protocol.c line 1025
>  devc-> trigger_pos = tpos-> ram_saddr + 1;
>  Use of real_pos in the original doubtful see commit!
>  Looks good with me at sigrok-cli, with PV problems.
>  Please verify the trigger point with several defined signals.

Use 
struct dslogic_trigger_pos 
from Dreamsourcelab-Project. 

Patch is finished. Push it -> Github !!
Comment 5 Jörg 2018-06-06 07:16:25 CEST
(In reply to Jörg from comment #4)
> (In reply to Jörg from comment #3)
> > (In reply to Jörg from comment #2)
> > > 1431655765 is
> > > 5555 5555 (16)
> > > 0101 0101 0101 0101 0101 0101 0101 0101 (2)
> > > 
> > > a very special value. What does that mean ?
> > > 
> > > mymistake
> > > range for devc-> trigger_pos:   1*num_samples .... 2*num_samples.
> > 
> > Change protocol.c line 1025
> >  devc-> trigger_pos = tpos-> ram_saddr + 1;
> >  Use of real_pos in the original doubtful see commit!
> >  Looks good with me at sigrok-cli, with PV problems.
> >  Please verify the trigger point with several defined signals.
> 
> Use 
> struct dslogic_trigger_pos 
> from Dreamsourcelab-Project. 
> 
> Patch is finished. Push it -> Github !!

pull request at 
https://github.com/sigrokproject/libsigrok/pull/8
Comment 6 Uwe Hermann 2018-06-16 19:53:27 CEST
Fixed in 10481ef05d51304a30e38533ca93cbc05b24a8c9, thanks!

For reference, the problem was that the libsigrok driver was using a "struct dslogic_trigger_pos" which was once correct for the vendor 0.95 firmware/bitstream combination.

However, since we now use 0.97, the struct needed to be updated to the vendor changes.

I've verified the fix on DSLogic (original), DSLogic Basic and DSLogic Plus.