CW305 Division by zero error

I am trying to capture traces on CW305, sometimes during the capture sequence during
ret = cw.capture_trace(scope, target, text, key), I get the following error. This only happens sometimes during capture_trace() and not all the time. Is there a reason for this?


ZeroDivisionError Traceback (most recent call last)
in
101 keys.append(key)
102
–> 103 ret = cw.capture_trace(scope, target, text, key)
104 if not ret:
105 print(“Failed capture”)

c:\users\myue8\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer_init_.py in capture_trace(scope, target, plaintext, key, ack)
335 target.simpleserial_write(‘p’, plaintext)
336
–> 337 ret = scope.capture()
338
339 i = 0

c:\users\myue8\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer\capture\scopes\OpenADC.py in capture(self)
344 # with DelayedKeyboardInterrupt():
345 if not self.adc.stream_mode:
–> 346 return self.qtadc.capture(self.adc.offset, self.clock.adc_freq, self.adc.samples)
347 else:
348 return self.qtadc.capture(None)

c:\users\myue8\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer\capture\scopes_qt.py in capture(self, offset, adc_freq, samples)
108
109 def capture(self, offset=None, adc_freq=29.53E6, samples=24400):
–> 110 timeout = self.sc.capture(offset, adc_freq, samples)
111 timeout2 = self.read()
112

c:\users\myue8\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer\capture\scopes_OpenADCInterface.py in capture(self, offset, adc_freq, samples)
2022 # give time for ADC to finish reading data
2023 # may need to adjust delay
-> 2024 cap_delay = (7.37E6 * 4 * samples) / (adc_freq * 24400)
2025 cap_delay *= 0.001
2026 time.sleep(cap_delay+sleeptime)

ZeroDivisionError: float division by zero

Which version of ChipWhisperer are you using?
Jean-Pierre

I think my firmware is 0.30. I’m not sure how to check the software version, it must be 5.x

You can get the version from cw.__version__.

How did you install it? If it’s from the git develop branch, there has been some work around there in recent months which may have broken things from time to time (but that should be fixed now).

Also, what does self.clock show?

I did install it from the git branch. CW version is 5.5
scope.clock displayed the following:
adc_src = clkgen_x1
adc_phase = 0
adc_freq = 0
adc_rate = 0.0
adc_locked = True
freq_ctr = 0
freq_ctr_src = extclk
clkgen_src = system
extclk_freq = 10000000
clkgen_mul = 2
clkgen_div = 1
clkgen_freq = 192000000.0
clkgen_locked = True

I can’t pinpoint the issue but I’m almost certain it will disappear if you update to the latest release.

Jean-Pierre

I will try that thanks