Chip whisperer build firmware error

When I was learning Lab 3_3 - DPA on Firmware Implementation of AES in SCA101 there was a problem,So I need help here, thank you.
My settings are as follows:

The output of the run is as follows:
INFO: Found ChipWhisperer😍
Building for platform CWLITEARM with CRYPTO_TARGET=AVRCRYPTOLIB
SS_VER set to SS_VER_1_1
Blank crypto options, building for AES128
rm -f – simpleserial-aes-CWLITEARM.hex
rm -f – simpleserial-aes-CWLITEARM.eep
rm -f – simpleserial-aes-CWLITEARM.cof
rm -f – simpleserial-aes-CWLITEARM.elf
rm -f – simpleserial-aes-CWLITEARM.map
rm -f – simpleserial-aes-CWLITEARM.sym
rm -f – simpleserial-aes-CWLITEARM.lss
rm -f – objdir/.o
rm -f – objdir/
.lst
rm -f – simpleserial-aes.s simpleserial.s stm32f3_hal.s stm32f3_hal_lowlevel.s stm32f3_sysmem.s aes-independant.s aes_enc.s aes_keyschedule.s aes_sbox.s aes128_enc.s
rm -f – simpleserial-aes.d simpleserial.d stm32f3_hal.d stm32f3_hal_lowlevel.d stm32f3_sysmem.d aes-independant.d aes_enc.d aes_keyschedule.d aes_sbox.d aes128_enc.d
rm -f – simpleserial-aes.i simpleserial.i stm32f3_hal.i stm32f3_hal_lowlevel.i stm32f3_sysmem.i aes-independant.i aes_enc.i aes_keyschedule.i aes_sbox.i aes128_enc.i
.
Welcome to another exciting ChipWhisperer target build!!
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
Copyright (C) 2020 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 C: simpleserial-aes.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/simpleserial-aes.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/simpleserial-aes.o.d simpleserial-aes.c -o objdir/simpleserial-aes.o
.
Compiling C: …/./simpleserial/simpleserial.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/simpleserial.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/simpleserial.o.d …/./simpleserial/simpleserial.c -o objdir/simpleserial.o
.
Compiling C: …/./hal/stm32f3/stm32f3_hal.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/stm32f3_hal.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/stm32f3_hal.o.d …/./hal/stm32f3/stm32f3_hal.c -o objdir/stm32f3_hal.o
.
Compiling C: …/./hal/stm32f3/stm32f3_hal_lowlevel.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/stm32f3_hal_lowlevel.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/stm32f3_hal_lowlevel.o.d …/./hal/stm32f3/stm32f3_hal_lowlevel.c -o objdir/stm32f3_hal_lowlevel.o
.
Compiling C: …/./hal/stm32f3/stm32f3_sysmem.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/stm32f3_sysmem.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/stm32f3_sysmem.o.d …/./hal/stm32f3/stm32f3_sysmem.c -o objdir/stm32f3_sysmem.o
.
Compiling C: …/./crypto/aes-independant.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/aes-independant.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/aes-independant.o.d …/./crypto/aes-independant.c -o objdir/aes-independant.o
.
Compiling C: …/./crypto/avrcryptolib//aes/aes_enc.c
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -DNO_EXTRA_OPTS -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DAVRCRYPTOLIB -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/aes_enc.lst -I…/./simpleserial/ -I…/./hal -I…/./hal/stm32f3 -I…/./hal/stm32f3/CMSIS -I…/./hal/stm32f3/CMSIS/core -I…/./hal/stm32f3/CMSIS/device -I…/./hal/stm32f4/Legacy -I…/./crypto/ -I…/./crypto/avrcryptolib//aes -I…/./crypto/avrcryptolib//gf256mul -std=gnu99 -MMD -MP -MF .dep/aes_enc.o.d …/./crypto/avrcryptolib//aes/aes_enc.c -o objdir/aes_enc.o
…/./crypto/avrcryptolib//aes/aes_enc.c:34:10: fatal error: avr/pgmspace.h: No such file or directory
34 | #include <avr/pgmspace.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** […/./Makefile.inc:469: objdir/aes_enc.o] Error 1

CalledProcessError Traceback (most recent call last)
~\chipwhisperer\jupyter\courses\sca101\Lab 3_3 - DPA on Firmware Implementation of AES (HARDWARE).ipynb in
----> 1 get_ipython().run_cell_magic(‘bash’, ‘-s “$PLATFORM” “$CRYPTO_TARGET” “$SS_VER”’, ‘cd …/…/…/hardware/victims/firmware/simpleserial-aes\nmake PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3\n’)

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2401 with self.builtin_trap:
2402 args = (magic_arg_s, cell)
→ 2403 result = fn(*args, **kwargs)
2404 return result
2405

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magics\script.py in named_script_magic(line, cell)
140 else:
141 line = script
→ 142 return self.shebang(line, cell)
143
144 # write a basic docstring:

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magic.py in (f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
→ 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magics\script.py in shebang(self, line, cell)
243 sys.stderr.flush()
244 if args.raise_error and p.returncode!=0:
→ 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err)
246
247 def _run_script(self, p, cell, to_close):

CalledProcessError: Command ‘b’cd …/…/…/hardware/victims/firmware/simpleserial-aes\nmake PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3\n’’ returned non-zero exit status 2.


CalledProcessError Traceback (most recent call last)
C:\Users\mb08\AppData\Local\Temp/ipykernel_17196/1325772540.py in
1 if VERSION == ‘HARDWARE’:
----> 2 get_ipython().run_line_magic(‘run’, ‘“Lab 3_3 - DPA on Firmware Implementation of AES (HARDWARE).ipynb”’)
3 elif VERSION == ‘SIMULATED’:
4 get_ipython().run_line_magic(‘run’, ‘“Lab 3_3 - DPA on Firmware Implementation of AES (SIMULATED).ipynb”’)

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2346 kwargs[‘local_ns’] = self.get_local_scope(stack_depth)
2347 with self.builtin_trap:
→ 2348 result = fn(*args, **kwargs)
2349 return result
2350

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magic.py in (f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
→ 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magics\execution.py in run(self, parameter_s, runner, file_finder)
722 with preserve_keys(self.shell.user_ns, ‘file’):
723 self.shell.user_ns[‘file’] = filename
→ 724 self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
725 return
726

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\interactiveshell.py in safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
2833 result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
2834 if raise_exceptions:
→ 2835 result.raise_error()
2836 elif not result.success:
2837 break

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\interactiveshell.py in raise_error(self)
329 raise self.error_before_exec
330 if self.error_in_exec is not None:
→ 331 raise self.error_in_exec
332
333 def repr(self):

[... skipping hidden 1 frame]

C:\Users\mb08\AppData\Local\Temp/ipykernel_17196/3899629446.py in
----> 1 get_ipython().run_cell_magic(‘bash’, ‘-s “$PLATFORM” “$CRYPTO_TARGET” “$SS_VER”’, ‘cd …/…/…/hardware/victims/firmware/simpleserial-aes\nmake PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3\n’)

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2401 with self.builtin_trap:
2402 args = (magic_arg_s, cell)
→ 2403 result = fn(*args, **kwargs)
2404 return result
2405

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magics\script.py in named_script_magic(line, cell)
140 else:
141 line = script
→ 142 return self.shebang(line, cell)
143
144 # write a basic docstring:

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magic.py in (f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
→ 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

C:\Users\mb08\AppData\Roaming\Python\Python37\site-packages\IPython\core\magics\script.py in shebang(self, line, cell)
243 sys.stderr.flush()
244 if args.raise_error and p.returncode!=0:
→ 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err)
246
247 def _run_script(self, p, cell, to_close):

CalledProcessError: Command ‘b’cd …/…/…/hardware/victims/firmware/simpleserial-aes\nmake PLATFORM=$1 CRYPTO_TARGET=$2 SS_VER=$3\n’’ returned non-zero exit status 2.

Hi

Change CRYPTO_TARGET="AVRCRYPTOLIB" to CRYPTO_TARGET="TINYAES128C".

1 Like

Thank you very much for your help. My problem has been solved :grin: