Errors when capturing with the CW1200

Hello,

I am facing two different problems on two different machines when using the CW1200 in streaming mode.

  1. On a first computer, I try to capture 6 millions sample traces. When doing so, some traces fail with the following message:
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:605) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid
(ChipWhisperer NAEUSB WARNING|File naeusb.py:933) Streaming: USB stream read timed out

In these traces, all the samples have the value -0.5. Despite the error, the result computed by the function is correct, and for 100 captured traces, 12 failed. Besides, increasing the timeout value does not change anything.

  1. On a mac laptop, I can capture traces containing 550 millions samples (with the timeout set to 200 seconds) but with a small success ratio. Besides, I could never succeed in capturing a trace with 600 millions samples. In both cases, the error message is the following:
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:605) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid
(ChipWhisperer NAEUSB WARNING|File naeusb.py:933) Streaming: USB stream read timed out
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:866) Unexpected sync byte in processData(): 0x0
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:713) Stream mode: done, no samples resulted from processing
(ChipWhisperer Scope ERROR|File OpenADC.py:787) Received fewer points than expected: 0 vs 600000000

In this case, the trace is empty, but the result is correct as well.

Having in my mind the explanation about usb given in the reply to my previous topic, could it explain both of these distinct behaviours?

Can you share your setup script, and the output of print(scope) once setup?

Hello,

I don’t use any setup script (we have our own framework), but the output of print(scope) for the first case is the following (it should be the same in the second case, except for the timeout value and the number of samples):

cw1200 Device
sn         = 4420312043304a383230313236323032
fw_version = 
    major = 1
    minor = 62
    debug = 0
gain = 
    mode = high
    gain = 30
    db   = 24.8359375
adc = 
    state          = False
    basic_mode     = rising_edge
    timeout        = 10
    offset         = 0
    presamples     = 0
    samples        = 6000000
    decimate       = 1
    trig_count     = 6434836
    fifo_fill_mode = normal
    stream_mode    = True
clock = 
    adc_src       = clkgen_x1
    adc_phase     = 0
    adc_freq      = 7384609
    adc_rate      = 7384609.0
    adc_locked    = True
    freq_ctr      = 0
    freq_ctr_src  = extclk
    clkgen_src    = system
    extclk_freq   = 10000000
    clkgen_mul    = 2
    clkgen_div    = 26
    clkgen_freq   = 7384615.384615385
    clkgen_locked = True
trigger = 
    triggers = tio4
    module   = basic
    aux_out  = False
io = 
    tio1         = serial_rx
    tio2         = serial_tx
    tio3         = high_z
    tio4         = high_z
    pdid         = high_z
    pdic         = high_z
    nrst         = high
    glitch_hp    = False
    glitch_lp    = False
    extclk_src   = hs1
    hs2          = clkgen
    target_pwr   = True
    tio_states   = (1, 1, 0, 0)
    cdc_settings = bytearray(b'\x00\x00\x00\x00')
glitch = 
    clk_src     = target
    width       = 10.15625
    width_fine  = 0
    offset      = 10.15625
    offset_fine = 0
    trigger_src = manual
    arm_timing  = after_scope
    ext_offset  = 0
    repeat      = 1
    output      = clock_xor
SAD = 
    threshold = 0
    reference = [0]
decode_IO = 
    trigger_pattern = None
    rx_baud         = 38360.23667279412
    decode_type     = USART

I think I’ve reproduced the problem. We will have to take some time to understand why it’s happening; we’ll update when we have an answer.

Hi @jpthibault

I’ve been having the same problem as @QLM with streaming mode when increasing the number of samples beyond a certain threshold (between 12 and 13 million in my case).
Here is the traceback I get:

(ChipWhisperer NAEUSB WARNING|File naeusb.py:890) Streaming: USB stream read timed out
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:605) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid
Traceback (most recent call last):
  File "acquisition.py", line 53, in <module>
    scope.capture()
  File "/home/me/chipwhisperer/software/chipwhisperer/capture/scopes/OpenADC.py", line 826, in capture
    a = self.sc.capture(None)
  File "/home/me/chipwhisperer/software/chipwhisperer/capture/scopes/_OpenADCInterface.py", line 607, in capture
    self.triggerNow()
  File "/home/me/chipwhisperer/software/chipwhisperer/capture/scopes/_OpenADCInterface.py", line 371, in triggerNow
    self.setSettings(initial | SETTINGS_TRIG_NOW)
  File "/home/me/chipwhisperer/software/chipwhisperer/capture/scopes/_OpenADCInterface.py", line 343, in setSettings
    self.sendMessage(CODE_WRITE, ADDR_SETTINGS, cmd, Validate=validate)
  File "/home/me/chipwhisperer/software/chipwhisperer/capture/scopes/_OpenADCInterface.py", line 229, in sendMessage
    self.serial.cmdWriteMem(address, pba)
  File "/home/me/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 765, in cmdWriteMem
    return self.usbserializer.cmdWriteMem(addr, data)
  File "/home/me/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 546, in cmdWriteMem
    self.sendCtrl(cmd, data=pload)
  File "/home/me/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 479, in sendCtrl
    self.handle.controlWrite(0x41, cmd, value, 0, data, timeout=self._timeout)
  File "/home/me/.local/lib/python3.8/site-packages/usb1/__init__.py", line 1330, in controlWrite
    return self._controlTransfer(request_type, request, value, index, data,
  File "/home/me/.local/lib/python3.8/site-packages/usb1/__init__.py", line 1307, in _controlTransfer
    mayRaiseUSBError(result)
  File "/home/me/.local/lib/python3.8/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "/home/me/.local/lib/python3.8/site-packages/usb1/__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorPipe: LIBUSB_ERROR_PIPE [-9]

Increasing scope.adc.timeout does not change anything. In fact, Streaming: USB stream read timed out is displayed almost immediately after calling scope.arm(), regardless of the actual value of scope.adc.timeout

Do you have an update on this issue ?