Sampling frequency

Hello,
I am measuring the power consumption during the execution of a bunch of codes. But, I would like to know for my execution what is the frequency of the target board? and is it supposed o be the same as the frequency of the chipwhisperer? if not how does this affect the sampling?

How can I figure out the sampling rate i.e., how many samples / clock cycles

You’ll have to give more information about your setup. What is your target, how is it connected to ChipWhisperer, and what are your scope.clock settings?

I am using a cw308 with an STM32F4 target board.
the scope.clock gives me the following:

adc_src = clkgen_x4
adc_phase = 0
adc_freq = 29538459
adc_rate = 29538459.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

Does it mean the frequency of the ADC sampling is 4 times the clock of the victim board? 4 x 7384615.384615385 ?
What is then the extclk_freq?

Yes, ADC is sampling at 4x the victim’s clock frequency.

From help(scope.clock):

| extclk_freq
| The input frequency from the EXTCLK source in Hz.
|
| This value is used to help calculate the correct CLKGEN settings to
| obtain a desired output frequency when using EXTCLK as CLKGEN input.
| It is not a frequency counter - it is only helpful if the EXTCLK
| frequency is already known.

EXTCLK is an external clock that you can optionally provide on the HS1 pin, in cases where the victim’s clock is not sourced from ChipWhisperer. In your case, with our STM32F4 target, you don’t need to worry about that, and so extclk_freq is not relevant.

If you set scope.clock.freq_ctr_src = 'clkgen', then you should see that scope.clock.freq_ctr is around 7.37e6.