Problem using offset to capture long traces

Hmm, I’m not getting the “Trigger not found” message when I run your notebook.
Do you get it on a fresh run of the notebook? I’m not sure about that one, but maybe resolving the other issues will take care of it for you:

One issue I see is that you’re not setting scope.adc.samples to adc_samples, so everything is going to be off. Also, it would be a good idea to put a sanity check around tot_len = scope.adc.trig_count, and really, since it’s supposed to be constant, it’s best to get that information only once at the beginning and then use it for the rest of the captures.

Here’s a simpler offset capture function that I’ve used without any problems for > million cycle captures, adapted from the demos/CW305_ECC.ipynb notebook; give that a try on your system:

TOTAL_CYCLES = xxx
scope.adc.samples = 24000

def get_traces(N=50):
    traces = []
    segments = math.ceil(TOTAL_CYCLES / scope.adc.samples)
    for i in tnrange(N, desc='Capturing traces'):
        scope.adc.offset = 0 
        wave = np.array([])
        for j in range(segments):
            ret = cw.capture_trace(scope, target, text, key)
            if not ret:
                print("Failed capture")
                continue
            wave = np.append(wave, ret.wave)
            scope.adc.offset += scope.adc.samples

        traces.append(Trace(wave, ret.textin, ret.textout, None))

    return traces