Hi,
I recently bought the LVL1 chipwhisperer kit, and I’m trying to go through the tutorials to get some experience. I managed to do the tutorials for AES, but when trying tutorial in jupyter/courses/sca202 ( SPA against RSA on XMEGA (8-bit implementation)), things do not go as planned.
Indeed, I cannot capture traces with the code provided: when I call scope.capture()
, I get an error
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 0b
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 0a
The compilation seemed to work (and so did the target programming), although there was a warning:
SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
make[1]: '.dep' is up to date.
SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
.
Welcome to another exciting ChipWhisperer target build!!
avr-gcc (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.
Compiling:
simpleserial-rsa.c ...Done!
.
Compiling:
simpleserial-rsa-xmega.c: In function 'load_bigint_from_os':
simpleserial-rsa-xmega.c:237:9: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
237 | while(1);
| ^~~~~
simpleserial-rsa-xmega.c:238:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
238 | return 1;
| ^~~~~~
simpleserial-rsa-xmega.c: In function 'get_pt':
simpleserial-rsa-xmega.c:217:19: warning: initialization of 'const bigint_t *' from incompatible pointer type 'const uint8_t *' {aka 'const unsigned char *'} [-Wincompatible-pointer-types]
217 | #define ENCRYPTED encrypted_x
| ^~~~~~~~~~~
simpleserial-rsa-xmega.c:314:25: note: in expansion of macro 'ENCRYPTED'
314 | const bigint_t* a = ENCRYPTED;
| ^~~~~~~~~
simpleserial-rsa-xmega.c ...Done!
.
Compiling:
simpleserial-rsa-arm.c ...Done!
.
Compiling:
.././simpleserial/simpleserial.c ...Done!
.
Compiling:
.././hal/xmega/XMEGA_AES_driver.c ...Done!
.
Compiling:
.././hal/xmega/uart.c ...Done!
.
Compiling:
.././hal/xmega/usart_driver.c ...Done!
.
Compiling:
.././hal/xmega/xmega_hal.c ...Done!
.
Compiling:
.././crypto/avrcryptolib//rsa/rsa_basic.c ...Done!
.
Compiling:
.././crypto/avrcryptolib//bigint/bigint.c ...Done!
.
LINKING:
simpleserial-rsa-CWLITEXMEGA.elf ...Done!
.
Creating load file for Flash: simpleserial-rsa-CWLITEXMEGA.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature simpleserial-rsa-CWLITEXMEGA.elf simpleserial-rsa-CWLITEXMEGA.hex
.
Creating load file for Flash: simpleserial-rsa-CWLITEXMEGA.bin
avr-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature simpleserial-rsa-CWLITEXMEGA.elf simpleserial-rsa-CWLITEXMEGA.bin
.
Creating load file for EEPROM: simpleserial-rsa-CWLITEXMEGA.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex simpleserial-rsa-CWLITEXMEGA.elf simpleserial-rsa-CWLITEXMEGA.eep || exit 0
.
Creating Extended Listing: simpleserial-rsa-CWLITEXMEGA.lss
avr-objdump -h -S -z simpleserial-rsa-CWLITEXMEGA.elf > simpleserial-rsa-CWLITEXMEGA.lss
.
Creating Symbol Table: simpleserial-rsa-CWLITEXMEGA.sym
avr-nm -n simpleserial-rsa-CWLITEXMEGA.elf > simpleserial-rsa-CWLITEXMEGA.sym
SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
Size after:
text data bss dec hex filename
12320 22 126 12468 30b4 simpleserial-rsa-CWLITEXMEGA.elf
+--------------------------------------------------------
+ Default target does full rebuild each time.
+ Specify buildtarget == allquick == to avoid full rebuild
+--------------------------------------------------------
+--------------------------------------------------------
+ Built for platform CW-Lite XMEGA with:
+ CRYPTO_TARGET = AVRCRYPTOLIB
+ CRYPTO_OPTIONS = RSA
+--------------------------------------------------------
As suggested by @jpthibault in this post, I used his .hex file and it worked. So I’m guessing the problem comes from my compiler. What should I do to fix my problem? I suppose I have to change the compiler to a specific version, but how do I do that, and which version should I choose? I’m using Windows.