"Trigger not found in ADC data" for long samples

Hi everyone,

I have been working on power analysis of a USB device with the Chip-Whisperer Lite and PHY-Whisperer.
I’m trying to create a long sample of the power consumption of a USB device ( around 50ms).

This is part of my code:

...
phy.set_capture_size(8188)
scope.adc.samples = 24430
...
data = []
for offset in range(250):     
    ...
    scope.adc.offset = offset*24430
    ...
    phy.set_trigger(1, delays=[0], widths=[10])
    phy.set_pattern(pattern=([***]))
    if scope.capture():
            print("Could not capture")
    else:
        trace = scope.get_last_trace()
    data.extend([trace])
...

The problem is when offset is larger than 62, so scope.adc.offset equals 1514660 and larger, I get the following ERROR:

(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:1044) Trigger not found in ADC data. No data reported!
(ChipWhisperer Scope ERROR|File OpenADC.py:820) Received fewer points than expected: 0 vs 24430
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:1044) Trigger not found in ADC data. No data reported!
(ChipWhisperer Scope ERROR|File OpenADC.py:820) Received fewer points than expected: 0 vs 24430

I also tried adding a delay to set_trigger, but the delay needs to be in the range of [0, 2^20-1] and it’s not enough for my test.

any ideas?

Thank you!

You may simply need to increase the capture timeout via scope.adc.timeout.

How long should the timeout be?
I tried 120 and it looks like I get the error earlier than 2 minutes.

2 minutes is definitely excessive, there must be something else at play.
Can you share all the relevant Python code? For example the code above doesn’t show when you’re arming the scope.

The relevant python code:

...
SCOPETYPE = 'OPENADC'
PLATFORM = 'CWLITE'
SS_VER = 'SS_VER_2_1'
%run "Setup_Scripts/Setup_Generic.ipynb"

phy = pw.Usb()
phy.con(program_fpga=True)
phy.set_power_source("off")
time.sleep(0.5)
phy.reset_fpga()
phy.set_usb_mode('auto')
phy.set_capture_size(8188)
scope.adc.samples = 24430
scope.gain.db = 56
phy.set_power_source("host")

data = []
for offset in range(250):     
    scope.adc.offset = offset*24430
    phy.arm()
    scope.arm()
    phy.set_trigger(1, delays=[0], widths=[10])
    phy.set_pattern(pattern=([***]))
    if scope.capture():
            print("Could not capture")
    else:
        trace = scope.get_last_trace()
    data.extend([trace])
...```

I don’t have a full picture of what you’re doing and how your target behaves, but could it simply be that PW simply isn’t triggering any more (i.e. because it doesn’t see pattern at a certain time post power-up)? Can you confirm with a logic analyzer that PW is still sending triggers to CW when offset > 62?

Also, it seems backwards to be arming PW, and then changing its parameters after arming.

Finally, I’ve updated PW firmware earlier this month to add some new features that could be useful for what you’re doing: have a look at the “Triggering Multiple Times” section of the demo notebook.

We haven’t updated the pip package yet, so you’ll have to install from git (master branch) to get this new feature.