cancel
Showing results for 
Search instead for 
Did you mean: 

How to Load demo code in STM32L562E-DK board after Executing TFM_UPDATE.sh

PYada.1
Associate III

Hello,

I am using the STM32L562E-DK board. I have tried the Secure boot example located in "STM32CubeL5-master\Projects\STM32L562E-DK\Applications\TFM". I have followed mentioned steps in the readme.MD file. Now I want to load the default demo binary provided by "https://www.st.com/en/evaluation-tools/stm32l562e-dk.html#documentation" > STM32L562E-DK compiled demo binary But I am not able to program it using STMCube Programmer. The programmer log is as follows.

=====================================

 14:23:58:394 : STLinkUSBDriver.dll loaded

 14:23:58:394 : STLinkUSBDriver.dll loaded

 14:23:58:394 : ST-LINK SN : 0026003E3137511733333639

 14:23:58:395 : ST-LINK FW : V3J8M3

 14:23:58:397 : Board    : STM32L562E-DK

 14:23:58:399 : Voltage   : 3.28V

 14:24:00:000 : Error: ST-LINK error (DEV_TARGET_NOT_HALTED)

 14:24:00:037 : Disconnected

=========================================

Please help to flash demo firmware.

3 REPLIES 3
Imen.D
ST Employee

Hello @PYada.1​,

Check your USB cable, connectors.

You can try to connect in "under reset" mode, or get the device into bootloader mode, then connect the debugger.

Try by connecting to bootloader setting on RSS : BOOT0 to VDD.

Otherwise, please refer to this post, it may be helpful.

Hope my answer will solve your issue!

When your question is answered, please close this topic by choosing Select as Best. This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
PYada.1
Associate III

Thanks to @Imen DAHMEN​  FOr quick response,

FYI, the TF-M application is working as expected. my goal is to run the normal application without a trust zone.

I have tried it, but it is not connecting randomly. I can connect the board using Cube programmer in hot-plug mode.

As per your suggested post, I have changed the RDP level to 0xAA. But still, I am not able to program my normal application.

I am attaching the log of the CUbe programmer for reference purposes.

From the log, it seems that flash is write-protected and because of it, I am not able to flash program(primary assumption).

Is there any script or method available that reset all secure protection and mass erase it or switch from demo TF-M firmware to without bootloader application?

PYada.1
Associate III

After a certain retry, I was able to do mass erase but after that, I am not able to connect it with the Cube programer

I have tried to check the RDP level using the following command but I am getting errors.

Attaching error log for reference purpose.

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>.\STM32_Programmer_CLI.exe -c port=SWD freq=3300 mode=HotPlug -ob displ

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

            STM32CubeProgrammer v2.8.0

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

ST-LINK SN : 0026003E3137511733333639

ST-LINK FW : V3J8M3

Board    : STM32L562E-DK

Voltage   : 3.28V

SWD freq  : 3300 KHz

Connect mode: Hot Plug

Reset mode : Software reset

Device ID  : 0x472

Revision ID : Rev Z

Reconnecting with the recommended frequency (1000 kHz)!

ST-LINK SN : 0026003E3137511733333639

ST-LINK FW : V3J8M3

Board    : STM32L562E-DK

Voltage   : 3.28V

SWD freq  : 1000 KHz

Connect mode: Hot Plug

Reset mode : Software reset

Device ID  : 0x472

Revision ID : Rev Z

Reconnected with the recommended frequency (3300 kHz)!

Device name : STM32L5xx

Flash size : 512 KBytes (default)

Device type : MCU

Device CPU : Cortex-M33

BL Version : 0x__

UPLOADING OPTION BYTES DATA ...

 Bank     : 0x00

 Address    : 0x40022040

 Size     : 32 Bytes

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

Error: Uploading Option Bytes bank: 0 failed

Error: Initializing the Option Bytes failed

 0%