cancel
Showing results for 
Search instead for 
Did you mean: 

Can't access STM32L552 after setting SRAM2-RST to 0

tosa
Associate

I've been trying to run the SBSFU example from STM32Cube_FW_L5_V1.2.0.

The option bytes I set initially were:

TZEN=1

DBANK=1 (was already 1)

SECWM1_PSTRT=0x0 and SECWM1_PEND=0x7f

SECWM2_PSTRT=0x1 and SECWM2_PEND=0x0.

That allowed me to load SBSFU bootloader in STMCubeIDE and debug it using SWI. All was good.

The bootloader failed at tfm_low_level_security.c:148 because I had a wrong SEC Boot Address in the option bytes. So I then changed SECBOOTADD0 to 0x180010 and verified it, and then SRAM2-RST to 0 as readme.txt suggested. I have not changed the RDP value.

After setting SRAM2-RST to 0 the programmer can no longer connect to the processor.

When trying to connect normally I get:

./STM32_Programmer_CLI -c port=SWD mode=normal --hardRst -ob displ

    -------------------------------------------------------------------

                      STM32CubeProgrammer v2.4.0                

    -------------------------------------------------------------------

ST-LINK SN : xxxx

ST-LINK FW : V2J36M26

Voltage   : 3,27V

Error: ST-LINK error (DEV_TARGET_NOT_HALTED)

When using hotplug:

/STM32_Programmer_CLI -c port=SWD mode=HotPlug -ob displ

    -------------------------------------------------------------------

                      STM32CubeProgrammer v2.4.0                

    -------------------------------------------------------------------

ST-LINK SN : xxxx

ST-LINK FW : V2J36M26

Voltage   : 3,27V

SWD freq  : 4000 KHz

Connect mode: Hot Plug

Reset mode : Software reset

Device ID : 0x472

Device name : STM32L5xx

Flash size : 512 KBytes (default)

Device type : MCU

Device CPU : Cortex-M33

UPLOADING OPTION BYTES DATA ...

 Bank        : 0x00

 Address     : 0x40022040

 Size        : 32 Bytes

Error: Uploading Option Bytes bank: 0 failed

Error: Initializing the Option Bytes failed

Setting any of the option bytes doesn't work either, I get the same message.

Is there any way to reset this?

Thanks,

Tom

2 REPLIES 2
Jocelyn RICARD
ST Employee

Hello Tom,

if you haven't modified the code, it should apply the protections setup in main.h, including RDP.

You should be able to recover by connecting to bootloader setting BOOT0 to VDD.

Then connect STM32CubeProgrammer either through UART, USB, even JTAG.

The point is that, when in RDP1, the JTAG requires that code is running in non secure to be able to attach.

When starting bootloader, the secure part of the bootloader will launch the non secure part, and then you can attach.

Best regards

Jocelyn

Hi @Jocelyn RICARD​ ,

I was trying to disable Tzen in my nucleo-l55ze-q (stm32l55), but before disabling i forgot to flash toggle gpio programmer into board, and tried to set RDP to 55 and i clicked apply,

From that moment it is not able to detect the STlink!..

I am stuck here . :relieved_face:

please give me any suggestions ...

Thanks and Regards

Teju S H