Skip to main content
HQIN.1
Associate
June 3, 2021
Solved

How can i reset the HDP2EN to 0

  • June 3, 2021
  • 1 reply
  • 731 views

Currently, i working on the nucleo-L552zeq and i run the SBSFU exemple propose by the cubeL5. i use the script regression.sh and the script the SBSFU_UPDATE.sh to initialize the board and download the firmware. this example can work normally on the board.

0693W00000Ba1ADQAZ.png 

Then i reset the board to some Trustzone project without SBSFU. The Trustzone project still work but then i can't use those 2 script to run the SBSFU-TrustZone project because the HDP2EN no egal to 0.

0693W00000Ba1AwQAJ.png 

I try to modify this option byte directly with STM32cubeProgrammer, it dosen't work. then i search the user manul and know that i need to modify the registe FLASH_SECWM2R2 and FLASH_SECHDPCR to reset the HDP2EN.

I add this 2 line into my TrustZone project and place it in the main.c(GPIO_IOToggle_TrustZone_Secure/Application/User/main.c) but after i lauch the program, the HDP2EN is still egal to 1.

0693W00000Ba1BkQAJ.pngSo how can i reset the HDP2EN by setting these 2 registes?

Thanks in advance.

This topic has been closed for replies.
Best answer by Bubbles

Hello @HQIN.1​ ,

clearing the HDP2EN involves Option byte programming, it's not just simple register operation.

I believe easiest is to use functions from stm32l5xx_hal_flash_ex.c to update the Option Bytes.

Jarda

1 reply

Bubbles
BubblesBest answer
ST Employee
June 9, 2021

Hello @HQIN.1​ ,

clearing the HDP2EN involves Option byte programming, it's not just simple register operation.

I believe easiest is to use functions from stm32l5xx_hal_flash_ex.c to update the Option Bytes.

Jarda

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.