Skip to main content
DonPavlov
Associate II
September 30, 2020
Question

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

  • September 30, 2020
  • 14 replies
  • 2629 views

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.

    This topic has been closed for replies.

    14 replies

    Frantz LEFRERE
    ST Employee
    September 30, 2020

    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
    DonPavlovAuthor
    Associate II
    September 30, 2020
    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
    September 30, 2020

    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
    DonPavlovAuthor
    Associate II
    September 30, 2020
    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
    September 30, 2020

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

    DonPavlov
    DonPavlovAuthor
    Associate II
    September 30, 2020

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

                          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
    September 30, 2020

    I will handle your issue by mail

    DonPavlov
    DonPavlovAuthor
    Associate II
    September 30, 2020

    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
    September 30, 2020

    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.

    PYada.1
    Associate III
    August 19, 2021

    @Frantz LEFRERE​ ,

    I am facing same issue, can you please help me to recover board? I am using STM32L562E-DK Discovery kit.

    Frantz LEFRERE
    ST Employee
    August 19, 2021

    This video : https://www.youtube.com/watch?v=4UW8lnbV1cA describes how to proceed with a Nucleo.

    The only difference with discovery board is how to enter in bootloader.

    For the activation of the  STM32L562E-DK Discovery bootloader, the procedure is describe in the user manual :

    https://www.st.com/resource/en/user_manual/um2617-discovery-kit-with-stm32l562qe-mcu-stmicroelectronics.pdf

    6.4.2 Boot from RSS

    "just by applying 3V3 on the PH3-BOOT0 signal between R32 and R31"

    then press reset.

    After this you should be able to connect with Cubeprogrammer in hotplug mode and do a RDP regression.