cancel
Showing results for 
Search instead for 
Did you mean: 

How can i reset the HDP2EN to 0

HQIN.1
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Bubbles
ST Employee

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.

View solution in original post

1 REPLY 1
Bubbles
ST Employee

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.