cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU example code

Srushty_global
Associate

Hi ,
i am using STM32L4R9 based dev board STLINK-V3MINIE and wanted to use SBSFU, used the example code STM32L432KC_Nucleo_1_image from the library and flashed the SECoreBIN followed by SBSFU and then the userAPP code, but while flashing userAPP ,i got the below error,

/*

STMicroelectronics ST-LINK GDB server. Version 6.1.0
Copyright (c) 2022, STMicroelectronics. All rights reserved.

Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------

 

Log output file: c:\users\abinay~1.lda\appdata\local\temp\stm32cubeprogrammer_a21060.log
ST-LINK SN : 003500124D46501420383832
ST-LINK FW : V3J9M3
Board : STLINK-V3MINIE
Voltage : 3.26V
SWD freq : 24000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x470
Revision ID : Rev V
Device name : STM32L4Rxxx/STM32L4Sxxx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : --
Debug in Low Power mode enabled

 

Memory Programming ...
Opening and parsing file: st-link_gdb_server_a21060.srec
File : st-link_gdb_server_a21060.srec
Size : 18.23 KB
Address : 0x08010200


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [16 20]
Error: failed to erase memory


Error: failed to erase memory
Shutting down...
Exit.
*/

I am a new bie to the subject and i immediately realized that the readme file,said compile not flash ,
now, i am not able to program anything into the board,
Need expert advise to resolve the issue.





1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello @Srushty_global ,

it looks like you have already flashed a SBSFU that turned on some security features.

First I would recommend reading SBSFU related documentation.

By default, the SBSFU example will enable RDP 1 and add write protection on secure boot code.

So, the first thing to do with your board is a regression: set RDP to 0xAA and then remove the write protections using STM32CubeProgrammer. (I would recommend using last version of the programmer also).

Then, you may disable the protections in the SBSFU code by uncommenting SECBOOT_DISABLE_SECURITY_IPS in app_sfu.h and rebuild everything.

You will also need to adapt the code to your new target: Check UART used, LEDs, button, flash driver and finally mapping to fit the different memory sizes.

I hope this will help

Best regards

Jocelyn

 

View solution in original post

2 REPLIES 2
Jocelyn RICARD
ST Employee

Hello @Srushty_global ,

it looks like you have already flashed a SBSFU that turned on some security features.

First I would recommend reading SBSFU related documentation.

By default, the SBSFU example will enable RDP 1 and add write protection on secure boot code.

So, the first thing to do with your board is a regression: set RDP to 0xAA and then remove the write protections using STM32CubeProgrammer. (I would recommend using last version of the programmer also).

Then, you may disable the protections in the SBSFU code by uncommenting SECBOOT_DISABLE_SECURITY_IPS in app_sfu.h and rebuild everything.

You will also need to adapt the code to your new target: Check UART used, LEDs, button, flash driver and finally mapping to fit the different memory sizes.

I hope this will help

Best regards

Jocelyn

 

Thank you Jocelyn, i set the RDP to default state(0xAA) and i was able to program the controller.