ChipWhiseprer 5.1.0 does not support optimization level 0?

Hi all.
I could choose optimization level 0 with ChipWhisperer 0.12RC1.
Although, this is very old version.
So, I’m currently using ChipWhisperer 5.1.0.
However, I tried to use optimization level 0 by executing the following code, but it doesn’t work properly.

%%bash -s “$PLATFORM” “$CRYPTO_TARGET”
cd …/chipwhisperer-develop/hardware/victims/firmware/simpleserial-DLDDO_counter
make PLATFORM=$1 CRYPTO_TARGET=$2 OPT=0

The output is:

In file included from …/./hal/hal.h:78,
from simpleserial-aes.c:19:
c:/winavr-20100110/lib/gcc/…/…/avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay.h> won’t work as designed”
In file included from …/./hal/hal.h:78,
from …/./simpleserial/simpleserial.c:5:
c:/winavr-20100110/lib/gcc/…/…/avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay.h> won’t work as designed”
In file included from …/./hal/xmega/avr_compiler.h:132,
from …/./hal/xmega/usart_driver.h:62,
from …/./hal/xmega/uart.h:2,
from …/./hal/xmega/uart.c:1:
c:/winavr-20100110/lib/gcc/…/…/avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay.h> won’t work as designed”
In file included from …/./hal/xmega/avr_compiler.h:132,
from …/./hal/xmega/usart_driver.h:62,
from …/./hal/xmega/usart_driver.c:68:
c:/winavr-20100110/lib/gcc/…/…/avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay.h> won’t work as designed”
In file included from …/./hal/hal.h:78,
from …/./hal/xmega/xmega_hal.c:18:
c:/winavr-20100110/lib/gcc/…/…/avr/include/util/delay.h:90:3: warning: #warning “Compiler optimizations disabled; functions from <util/delay.h> won’t work as designed”

How can I compile my code using optimization level 0?

This looks to be an issue with avr-gcc/avrlibc issue. You’ll need to use a different optimization level.

I’m guessing setting optimizations is different in that older version of chipwhisperer, meaning your code wasn’t actually -O0.

Alex

Do you mean there is no way to compile with optimization level 0 in ChipWhisperer 5.1.0?

util/delay.h is not part of chipwhisperer, it’s part of avrlibc/avr-gcc. You can try removing #include <util/delay.h> from files in hal/xmega, but otherwise there’s nothing I can do to help. I’m not sure why it works on that old version of chipwhisperer - our xmega files are the same.