How to compile and load simpleserial-aes program with customized optimizations?

I am trying to optimize the simpleserial-aes program with different optimization flags with make file, that is, I am trying to add optimization flags to EXTRA_OPTS variable of the make file by following the avr-gcc documentation available on Atmel-optimizations. I tried adding multiple flags to EXTRA_OPTS variable but it always shows “CalledProcessError: Command ‘b’cd /home/cw/chipwhisperer/hardware/victims/firmware/simpleserial-aes\nmake PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3 OPT=-O0\n’’ returned non-zero exit status 2.” Is there any other way to optimize the programs with other flags of avr-gcc?

If you just want to modify the optimization level, we have a special variable called OPT, so you should do

make ... OPT=0

Extra opts is just there for adding macro defines.

I don’t think there’s really a good way of modifying the regular CFLAGS right now, so you’ll need to modify the makefile for the project if you want to turn off/on individual optimizations.

Alex

Hi @Alex_Dewar, the solution you suggested is helpful. I also found another way for optimizing these files. The Makefile.inc in the firmware directory has some CFLAGS variables which I was looking for optimizing. Thank you for your suggestion.