cancel
Showing results for 
Search instead for 
Did you mean: 

Change target from STM32WL55JC to STM32WLE5C8 without CubeMX

Foreen
Associate II

Hello,

I want to change target of BFU_2_Slots (1_Image_BFU, 1_Image_SECoreBin and also 1_Image_UserApp) from STM32CubeWL v1.3.0 (STM32Cube_FW_WL_V1.3.0/Projects/NUCLEO-WL55JC/Applications/BFU_2_Slots) from STM32WL55JC to STM32WLE5C8, but I do not know how should I do that properly, since CubeMX file is not available in this project.

Could anybody help me, please?

Thank you.

10 REPLIES 10
Jocelyn RICARD
ST Employee

Hello @Foreen ,

The STM32WLE5C8 has 64KB flash (instead of 256KB for STM32WL55JC). You don't have enough space to have BFU implementation here.

Best regards

Jocelyn

 

Hello @Jocelyn RICARD ,

Thank you for your answer. And is there any other way, how can I do the firmware update with STM32WLE5C8? 


Thank you.

Hi @Foreen ,

if you have a look to the X-CUBE-SBSFU, there is an example that addresses 64KB parts:

Projects\NUCLEO-G031K8\Applications\1_Image\

SBSFU takes 32KB by removing traces and using symmetric authentication using GCM.

For such small device, you may need to implement a simpler secure boot.

There are videos available explaining how to do this here 

Besides, if you do not need a secure boot you can implement a simple firmware update using your own bootloader.

Best regards

Jocelyn

 

Hello @Jocelyn RICARD ,

I tried the NUCLEO-G031K8 SBSFU demo (from STM32CubeExpansion_SBSFU_V2.6.2, no changes were made by me), and I was able to compile 1_Image_SECoreBin without any errors; unfortunately, I was unable to compile 1_Image_SBSFU, it threw RAM overflow:

14:25:32 **** Incremental Build of configuration Debug for project NUCLEO-G031K8_1_Image_SBSFU ****
make all 
arm-none-eabi-gcc -o "SBSFU.elf" @"objects.list"   -mcpu=cortex-m0plus -T"../STM32G031K8Tx.ld" --specs=nosys.specs -Wl,-Map="SBSFU.map" -Wl,--gc-sections -static -Xlinker  -L ../../../Linker_Common/STM32CubeIDE --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
/home/foreen/st/stm32cubeide_1.16.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: SBSFU.elf section `._user_heap_stack' will not fit in region `SB_RAM_region'
/home/foreen/st/stm32cubeide_1.16.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: region `SB_RAM_region' overflowed by 280 bytes
/home/foreen/st/stm32cubeide_1.16.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: warning: SBSFU.elf has a LOAD segment with RWX permissions

 Do you know what could I have done wrong? I did everything in accordance to readme files.

Thank you in advance.

Jocelyn RICARD
ST Employee

Hello @Foreen ,

I can reproduce the same. The issue is possibly related to evolution of gcc. It should have been working when the release was out with gcc version used at that time. And now, it fails because code generated (here this is RAM used actually) is a bigger. Here 280 bytes is really big !

One rapid change you can make to be able to build is to reduce the stack size from 0x400 to 0x2E0 in the SBSFU linker file. The actual stack usage should be double check though.

Best regards

Jocelyn

Hello @Jocelyn RICARD ,

Thank you, that helped! And why is the size of final image ~60 kB, when SBSFU is ~32 kB and user app ~19 kB? The SECoreBin is not included in the SBSFU image? Is there some free space in between the SBSFU and UserApp images? Or is it because the traces are not removed here?

And can I access the encryption algorithms located in the SBSFU/SECoreBin part of the image from UserApp, so I do not have to have the firmware for encryption algorithms doubled (in both SBSFU and UserApp part)?

Thank you in advance.

Hello @Foreen ,

Unfortunately the example uses 32KB for secure boot only with IAR thanks to the compact code it can generated.

In case of STM32CubeIDE with GCC, is uses 40KB (0xA000).

Now, as you are using STM32WL chip you have access to an HW AES. This could help reducing the footprint of the secure boot.

Regarding usage of crypto provided in Secure Engine, it should be possible as it is designed for that. You would need to create specific API, or make current API available to application.

Best regards

Jocelyn

Foreen
Associate II

Hello @Jocelyn RICARD ,

Ok, thank you! By any chance, is there some application manual/note for making the API, please?

And also how can I change the target from NUCLEO-G031K8 to STM32WLE5C8, if there is no CubeMX file is not available in this project?

Thank you in advance.

 

.Hello @Jocelyn RICARD ,

Ok, thank you! By any chance, is there some application manual/note for making the API, please?

And also how can I change the target from NUCLEO-G031K8 to STM32WLE5C8, if there is no CubeMX file is not available in this project?

Thank you in advance.