Help to building firmware

Hi,
I am facing problems building firmware in the tutorial 1 - Connecting to Hardware.ipynb in jupyter . First of all I am using:
-ChipWhisperer-Lite Capture
-CW308 UFO Baseboard
-CW308T-STM32F3
And I try with the code

%%bash
cd …/hardware/victims/firmware/simpleserial-base/
make PLATFORM=CW308_STM32F3 CRYPTO_TARGET=NONE

and I got the error like:


and with:
CalledProcessError: Command ‘b’#pwd\ncd …/hardware/victims/firmware/simpleserial-base/\nmake PLATFORM=CW308_STM32F3 CRYPTO_TARGET=NONE\n’’ returned non-zero exit status 2.
(Sorry that I can only post one photo here.)

I have install the Chipwhisperer following the Windows Installer, but still don’t know the reason.

Hi,

If you change %%bash to %%sh, does that fix your issue?

Alex

Hi,

I have exactly the same issue that she describes.
I have change the %%bash to %%sh, unfortunately that doesn’t fix the problem, has anyone an other idea please ?

Gabriel

Hi,

What operation system and install method have you used?

Can you run

%%bash
echo $PATH

and post the output as well?

Alex

Hi!
I have installed it in my local disk C, with a Windows 11Professional Operation System,& I have followed the “Windows Bundled Installer” step in the chipwhisperer official website documentation.

OK Here is a capture of the executed command :

Hope that it’s helpful.

Thank you for your help.

Hi! Just to tell you that it’s okay my problem is fix :grinning:, it was simply an error of writing in the code. (about adding the target reference name properly in the line make plateform…)

Good to hear you got it working.

Alex

Hi,
I am facing a new problems building firmware in the tutorial 1 - Connecting to Hardware.ipynb in jupyter.

I try with the code:
gmake PLATFORM=CW308_STM32F3 CRYPTO_TARGET=NONE

and I got the error:
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
gmake[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!!
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.

mkdir -p objdir-CW308_STM32F3
.
Compiling:
-en simpleserial-base.c …
-e Done!
.
Compiling:
-en …/./simpleserial/simpleserial.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_hal.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_hal_lowlevel.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_sysmem.c …
-e Done!
.
Assembling: …/./hal/stm32f3/stm32f3_startup.S
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -x assembler-with-cpp -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -DF_CPU=7372800 -Wa,-gstabs,-adhlns=objdir-CW308_STM32F3/stm32f3_startup.lst -I…/./simpleserial/ -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/ …/./hal/stm32f3/stm32f3_startup.S -o objdir-CW308_STM32F3/stm32f3_startup.o
.
LINKING:
-en simpleserial-base-CW308_STM32F3.elf …
arm-none-eabi-gcc: fatal error: /usr/local/Cellar/arm-none-eabi-gcc/10-2020-q4-major/gcc/bin/…/lib/gcc/arm-none-eabi/10.2.1/…/…/…/…/arm-none-eabi/lib/nano.specs: attempt to rename spec ‘link’ to already defined spec ‘nano_link’
compilation terminated.
gmake[1]: *** […/./Makefile.inc:495: simpleserial-base-CW308_STM32F3.elf] Error 1
gmake: *** […/./Makefile.inc:347: all] Error 2

The problem may appear on line 35 of the file/hal/stm32f3/Makefile.stm32f3:
LDFLAGS += --specs=nano.specs --specs=nosys.specs -T $(HALPATH)/stm32f3/LinkerScript.ld -Wl,–gc-sections -lm

Make version is as follows:
gmake -v
GNU Make 4.4.1
Built for x86_64-apple-darwin22.3.0
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

I don’t know how to solve this problem.
Thanks;

Hi,

Try removing the --specs=nano.specs from the makefile.

Alex

I tried to delete the – specs=nano. specs – specs=nosys. specs field, but I still encountered an error:
❯ gmake PLATFORM=CW308_STM32F3 CRYPTO_TARGET=NONE
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
gmake[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!!
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.

mkdir -p objdir-CW308_STM32F3
.
Compiling:
-en simpleserial-base.c …
-e Done!
.
Compiling:
-en …/./simpleserial/simpleserial.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_hal.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_hal_lowlevel.c …
-e Done!
.
Compiling:
-en …/./hal/stm32f3/stm32f3_sysmem.c …
-e Done!
.
Assembling: …/./hal/stm32f3/stm32f3_startup.S
arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -x assembler-with-cpp -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -DF_CPU=7372800 -Wa,-gstabs,-adhlns=objdir-CW308_STM32F3/stm32f3_startup.lst -I…/./simpleserial/ -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/ …/./hal/stm32f3/stm32f3_startup.S -o objdir-CW308_STM32F3/stm32f3_startup.o
.
LINKING:
-en simpleserial-base-CW308_STM32F3.elf …
/usr/local/Cellar/arm-none-eabi-gcc/10-2020-q4-major/gcc/bin/…/lib/gcc/arm-none-eabi/10.2.1/…/…/…/…/arm-none-eabi/bin/ld: error: linker script file ‘…/./hal/stm32f3/LinkerScript.ld’ appears multiple times
collect2: error: ld returned 1 exit status
gmake[1]: *** […/./Makefile.inc:495: simpleserial-base-CW308_STM32F3.elf] Error 1
gmake: *** […/./Makefile.inc:347: all] Error 2

Can you try rerunning the build with DEBUG=TRUE?

For me it worked when i changed it to
%%sh
cd …/hardware/victims/firmware/simpleserial-base/
make PLATFORM=CWNANO CRYPTO_TARGET=NONE

This will still cause errors:

❯ gmake PLATFORM=CW308_STM32F3 CRYPTO_TARGET=NONE DEBUG=TRUE
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
gmake[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!!
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.

mkdir -p objdir-CW308_STM32F3
.
Compiling:
-en simpleserial-base.c …
arm-none-eabi-gcc: error: unrecognized debug output level ‘TRUE’
gmake[1]: *** […/./Makefile.inc:504: objdir-CW308_STM32F3/simpleserial-base.o] Error 1
gmake: *** […/./Makefile.inc:347: all] Error 2