cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to program User Option Bytes SECWM1_PSTRT/SECWM1_PEND

Shaffi
Associate II

Hello ST,

I am using stm32u575 board for secure flash access, When TZEN is enabled i am able read and write to Secure flash(0x0C00 8000), but unable to read/write to non secure area(0x08100 0000). Then I used User Option Bytes
SECWM1_PSTRT/SECWM1_PEND to set the secure area SECWM1_PSTRT = 0x02 and SECWM1_PEND =0x02 but value of SECWM1R1 isn't  setting to 0xFF02FF02 but value remains to it 0xFFFF FF80 below is a snippet of my code, Not sure what I am doing wrong to set the SECWM1_PSTRT/SECWM1_PEND. Any help will highly be appreciated.

Shaffi_1-1729622447406.png

Regards,

Shafi

 

2 REPLIES 2
Shaffi
Associate II

I am know able to edit SECWM1_PSTRT/SECWM1_PEND after TZEN is set and the board is power cycled, but still  unable to access the non secure area(0x08100 0000). @Jocelyn RICARD 

Regards,

Shafi

Jocelyn RICARD
ST Employee

Hello @Shaffi,

if you want to write non secure flash from secure you need to request FLASH_TYPEPROGRAM_QUADWORD_NS.

You can check examples

STM32Cube_FW_U5_V1.6.0\Projects\NUCLEO-U575ZI-Q\Examples\FLASH\FLASH_EraseProgram_TrustZone\

STM32Cube_FW_U5_V1.6.0\Projects\NUCLEO-U575ZI-Q\Examples\FLASH\FLASH_ChangeOptionBytes\

Also, you can see how to set secure watermarks here

STM32Cube_FW_U5_V1.6.0\Projects\B-U585I-IOT02A\Applications\SBSFU\SBSFU_Boot\Src\low_level_security.c

Best regards

Jocelyn