Chipwhisperer Lite scope.capture() returns but timeout not yet expired

Hi,

I’m using CW Lite.
I’m setting timeout 6 seconds.
As I read in manual scope.capture() must block at least 6 seconds if it returns True

But actually I have it returned with True and even 1 second is not expired.
How that can be?

Many Thanks.

fw_version = 
    major = 0
    minor = 65
    debug = 0
gain = 
    mode = high
    gain = 30
    db   = 24.8359375
adc = 
    state          = True
    basic_mode     = rising_edge
    timeout        = 6
    offset         = 0
    presamples     = 0
    samples        = 5000
    decimate       = 1
    trig_count     = 4228775385
    fifo_fill_mode = normal
clock = 
    adc_src       = clkgen_x4
    adc_phase     = 0
    adc_freq      = 338557937
    adc_rate      = 338557937.0
    adc_locked    = True
    freq_ctr      = 0
    freq_ctr_src  = extclk
    clkgen_src    = system
    extclk_freq   = 10000000
    clkgen_mul    = 25
    clkgen_div    = 24
    clkgen_freq   = 100000000.0
    clkgen_locked = True
trigger = 
    triggers = tio4
    module   = basic
io = 
    tio1         = serial_rx
    tio2         = serial_tx
    tio3         = high_z
    tio4         = high_z
    pdid         = high_z
    pdic         = high_z
    nrst         = high
    glitch_hp    = True
    glitch_lp    = True
    extclk_src   = hs1
    hs2          = clkgen
    target_pwr   = True
    tio_states   = (1, 1, 0, 1)
    cdc_settings = bytearray(b'\x00\x00\x00\x00')
glitch = 
    clk_src     = clkgen
    width       = 10.15625
    width_fine  = 0
    offset      = 10.15625
    offset_fine = 0
    trigger_src = ext_single
    arm_timing  = no_glitch
    ext_offset  = 0
    repeat      = 1
    output      = glitch_only

Adctimeout = 6
Timeout 0.5s...
Trig_count = 131978769
perf_counter()=2593799.611912039
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:935) Trigger not found in ADC data. No data reported!
(ChipWhisperer Scope ERROR|File OpenADC.py:828) Received fewer points than expected: 0 vs 5000
scope.capture()=True
perf_counter()=2593799.795231367

This is the cause of your problem:

Your’re trying to clock ChipWhisperer way beyond the 105 MHz that it’s rated for.
Digital logic doesn’t work the way it’s supposed to when you do this; this is why the capture fails.

No, I’m not. The Freq is 100 MHZ.
This is done by command:

scope.clock.clkgen_freq = 100E6

Anadequate numbers in params adc_freq and adc_rate are also one of my questions.
Actually the system 96MHZ frequency is user and it is calculated like:

96 * clkgen_mul / clkgen_div = 96 * 25 / 24 = 100 MHZ

But I understand what you are talking about, I have adc_src = clkgen_x4 it seems it multiplies by 4. So I need to set up speed 4 times lower or set to clkgen_x1. I’ll try it, thanks!

Yes, that helped. Thanks!

CW-lite uses a 96 MHz input clock to generate its clocks.
When you set scope.clock.clkgen_freq = 100e6, it calculates the PLL multiplier and divider parameters required to take that 96 MHz clock to 100MHz, as you point out.

Since you have scope.clock.adc_src = clkgen_x4, it then routes that 100 MHz clock to a x4 PLL to generate the ADC sampling clock, which should result in a 400 MHz clock, but since this is way beyond spec you get something different. If you keep all the clocks in legal range, then everything should add up.

You also need to understand that the 100 MHz clock you’re generating here is fed to your target on the HS2 pin. Many of our targets can’t be clocked that high (STM32, xmega). Look at their datasheets to see their max frequency.

This parameter scope.clock.adc_src was not obvious for me, because it never used in example code.
I don’t use HS2 and generating speed. My target works on much higher speeds that CW can generate.