Hello,
My name is Samar Mohamed and I am working on a project that requires capturing power traces using ChipWhisperer with external target boards. I am currently using the CWLite1173 and my target is an Arduino Uno board (Joy-it, R3DIP).
As far as I know, only two connections are needed between the capture board and the Arduino board. Pin 16 in the capture board is connected to Pin 12 in the Arduino board for the Trigger. The Vin of the Arduino board is supplied with 5 V from an external DC power supply and I inserted a resistor of 1 ohm between their grounds. The Measure cable of the capture board is connected across the R terminals.
I uploaded the below code on the Arduino board but I got completely non-sense traces.
void setup() {
pinMode(12, OUTPUT);
digitalWrite(12,HIGH);
Serial.begin(9600);
}
void loop() {
byte array1[100] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100};
byte array2[100] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100};
int i;
int q;
byte sum [50];
for (int j = 0; j < 1000000000000; j++){
for(i=0; i < sizeof(array1) ; i++){
for (q = 0; q < sizeof(array2); q++){
sum[i] += array1[i] * array2[q];
}
}
for (i=0; i < sizeof(sum) ; i++){
Serial.println(sum[i]);
}
}
}
I tried to capture 6 times, each time I power off the DC power supply, arm the capture board, switch on the DC power supply, and finally capture the trace. The captures are in the attached link and I believe that they are all wrong but I don’t know the reason.
In the Jupyter file:
import chipwhisperer as cw
scope = cw.scope()
target = cw.target(scope)
scope.default_setup()
scope.clock.clkgen_freq = 6000000
scope.clock.adc_src = “clkgen_x1”
scope.adc.samples = 5000
scope.arm()
ktp = cw.ktp.Basic()
key, text = ktp.next()
trace1 = cw.capture_trace(scope, target,text).wave
%matplotlib notebook
import matplotlib.pylab as plt
plt.figure()
plt.plot(trace1,‘b’)
plt.show()
Kindly I need help urgently.
[Captures]:
(https://drive.google.com/drive/folders/1GNlUUfESRI7Jmr0Cs8nzO5438Hc0vFpf?usp=sharing)