2021-06-03 07:16 AM
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.
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.
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.
So how can i reset the HDP2EN by setting these 2 registes?
Thanks in advance.
Solved! Go to Solution.
2021-06-09 04:31 AM
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.
2021-06-09 04:31 AM
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.