Changing the resolution/sample frequency/clock frequency


#1

Hi,

I am using the CW lite with the UFO board with STM32F3 target.

I am running a long calculation, so that it doesn’t fit into the traces.
With a regular oscilloscope I would reduce the resolution or lower the sample frequency or I would raise the clock frequency of the device.

I don’t really understand how the CW scope settings exactly work and which commands in python would allow me to do the above.

Thanks,


#2

Hi Lauren,

For the typical ChipWhisperer capture setup, the target clock also clocks the ADC, so it is a little different than your typical oscilloscope setup. This means it isn’t quite as simple as just changing the sample frequency or the target’s clock frequency.

If you haven’t already, a first step you can take is to change scope.clock.adc_src from clkgen_x4 to clkgen_x1 (documented here: https://chipwhisperer.readthedocs.io/en/latest/api.html#chipwhisperer.capture.scopes._OpenADCInterface.ClockSettings.OpenADC.adc_src), which will reduce the sample frequency from being 4x larger than the target frequency to being the same. If you need to capture even longer traces, you have a few options:

  1. The CWLite supports downsampling (documented here: https://chipwhisperer.readthedocs.io/en/latest/api.html#chipwhisperer.capture.scopes._OpenADCInterface.TriggerSettings.OpenADC.decimate). For values >1 (with clkgen_x1 adc src), this will make your clock frequency lower than the target’s, which has various downsides, such as adding jitter and missing instructions.
  2. Capturing multiple traces with the same input, but with different offsets and stitching them together.
  3. Feeding a clock signal from the target into the ChipWhisperer. You should be to use the clock module in the ChipWhisperer to get whatever sampling frequency you want (within reason), though I haven’t done this myself, so I can’t vouch for how well it works.
  4. Running the target off a different clock than the ChipWhisperer and using a lower clock frequency for the ChipWhisperer. This is your typical oscilloscope setup and comes with most of the advantages (being able to set the clocks independently) and disadvantages (lots of jitter) that an oscilloscope has for side channel attacks.

Alex


#3

Ok Thanks, I’ll try this stuff.

-Lauren