cancel
Showing results for 
Search instead for 
Did you mean: 

Running the Homework for the L5 Board a second time. Now i get errors

DonPavlov
Associate II

Hi.,

Because i wanted to verify if the processes worked as well on my work provided Laptop. I ran the homework a second time.

The TFM Homework of course resulted in mutliple Errors and nothing worked. But now i can't even use the L5 Board anymore. I get no output on the Serial and the usb part shows a fail.txt with the following content:

The interface firmware FAILED to reset/halt the target MCU

Trying to connect the STCubeProgrammer also now fails with: DEV_TARGET_NOT_HALTED

So i can't manually wipe the device and restore it again.

Quick help would be appreciated.

15 REPLIES 15
Frantz LEFRERE
ST Employee

Hi,

if you launch the STEP1_prepare_L5_for_TFM.bat to you see any error ? If yes, could you show the log.

Br

DonPavlov
Associate II
C:\STM32SecuWS\TFM\Scripts>echo off
"STEP1 prepare L5-Nucleo option byte for TFM script"
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.5.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 066AFF353638425043085717
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L552ZE-Q
Voltage     : 3.27V
SWD freq    : 4000 KHz
Connect mode: Hot Plug
Reset mode  : Software reset
Device ID   : 0x472
Revision ID : Rev B
Device name : STM32L5xx
Flash size  : 512 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M33
 
 
Mass erase ...
 
Error: failed to erase memory
Error: Mass erase operation failed.
Please verify flash protection
 
MCU Reset
 
Software reset is performed
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.5.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 066AFF353638425043085717
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L552ZE-Q
Voltage     : 3.27V
SWD freq    : 4000 KHz
Connect mode: Hot Plug
Reset mode  : Software reset
Device ID   : 0x472
Revision ID : Rev B
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
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.5.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 066AFF353638425043085717
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L552ZE-Q
Voltage     : 3.27V
SWD freq    : 4000 KHz
Connect mode: Hot Plug
Reset mode  : Software reset
Device ID   : 0x472
Revision ID : Rev B
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
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.5.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 066AFF353638425043085717
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L552ZE-Q
Voltage     : 3.27V
SWD freq    : 4000 KHz
Connect mode: Hot Plug
Reset mode  : Software reset
Device ID   : 0x472
Revision ID : Rev B
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
"**************************************************************"
"Option setting"
"**************************************************************"
"TZ          : enabled "
"SRAM2_RST   : disabled "
"SECBOOTADD0 : 0x180032 -> 0x0C001900"
"DBANK       : enabled "
"SECWM1_PSTRT: 0x0      -> 0x08000000"
"SECWM1_PEND : 0x6F     -> 0x08037800"
"SECWM2_PSTRT: 0x7f     -> 0x0803f800"
"SECWM2_PEND : 0x00     -> 0x08000000"
"**************************************************************"
"Board is ready to receive the TFM binaries, press key"
Drücken Sie eine beliebige Taste . . .

Frantz LEFRERE
ST Employee

Please launch a command line and do this :

cd C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin

STM32_Programmer_CLI -c port=SWD mode=UR -ob displ

And share the result, this will allow me to understand your option byte configuration.

DonPavlov
Associate II
PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> .\STM32_Programmer_CLI.exe -c port=SWD mode=UR -ob displ
 
     -------------------------------------------------------------------
 
                      STM32CubeProgrammer v2.5.0
 
     -------------------------------------------------------------------
 
 
ST-LINK SN : 066AFF353638425043085717
 
ST-LINK FW : V2J37M26
 
Board      : NUCLEO-L552ZE-Q
 
Voltage    : 3.27V
 
Error: ST-LINK error (DEV_TARGET_NOT_HALTED)
 
PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>

 The target doesn't want to connect to the CubeProgrammer anymore.

Frantz LEFRERE
ST Employee

try this one : STM32_Programmer_CLI -c port=SWD mode=HotPlug -ob displ

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

                      STM32CubeProgrammer v2.5.0

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

ST-LINK SN : 066AFF353638425043085717

ST-LINK FW : V2J37M26

Board      : NUCLEO-L552ZE-Q

Voltage    : 3.27V

SWD freq   : 4000 KHz

Connect mode: Hot Plug

Reset mode : Software reset

Device ID  : 0x472

Revision ID : Rev B

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

PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>

Frantz LEFRERE
ST Employee

I will handle your issue by mail

DonPavlov
Associate II

Ok Thanks to support i now got my solution:

  • Connect CN11 Pin 5 and Pin 7
  • Press reset
  • run
 .\STM32_Programmer_CLI.exe -c port=SWD mode=HotPlug -ob displ 

now you should see some output.

  • run
STM32_Programmer_CLI -c port=SWD mode=HotPlug -ob RDP=0xAA

Optionally(not verified if it is the solution):

try running:

STEP9_remove_TrustZone.bat

it should work(while blue and red led are shining)

to reinstall the working state for the homework run step 1 and step2 batch files again

Frantz LEFRERE
ST Employee

To complete the previous message, the issue was due to the fact RDP level has been set to 0xBB ( level 1) with an empty flash.

To be able to connect we needed to activate embedded bootloader to connect and set the RDP to level 0.

Then connection is now possible.