Skip to main content
Foreen
Associate II
November 7, 2024
Question

Change target from STM32WL55JC to STM32WLE5C8 without CubeMX

  • November 7, 2024
  • 4 replies
  • 1809 views

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.

4 replies

Jocelyn RICARD
ST Employee
November 7, 2024

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

 

Foreen
ForeenAuthor
Associate II
November 8, 2024

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.

Jocelyn RICARD
ST Employee
November 13, 2024

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

 

Jocelyn RICARD
ST Employee
November 18, 2024

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

Foreen
ForeenAuthor
Associate II
November 18, 2024

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.

Jocelyn RICARD
ST Employee
November 19, 2024

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
ForeenAuthor
Associate II
November 20, 2024

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.

 

Jocelyn RICARD
ST Employee
November 20, 2024

Hello @Foreen ,

I don't know any documentation about this. Now the framework is quite simple to understand from the code.

For the porting, you will have to do it manually. STM32CubeMX can be still be used as a side tool to generate initialization code that you can copy in your project.

Best regards

Jocelyn