cancel
Showing results for 
Search instead for 
Did you mean: 

How to write protect STM32L4RZI internal flash

SReef.1
Associate

Hi!

I'm trying to lock internal flash on STM32L4RZI  MCU from writing, to disallow software to write on itself.

I use ST-Link utility, and when I lock at least one sector(In option bytes window), The flash is erased and then lock the wanted sector.

I tried the same method on another MCU - STM32L433RC, and it works fine.

I'm not sure what the problem is, but if there is any solution, or locking flash is impossible in this MCU, i would like to know.

Thank you!

1 REPLY 1
Amel NASRI
ST Employee

Hi @SReef.1​ ,

Did you tried using STM32CubeProgrammer or the example STM32Cube_FW_L4\Projects\NUCLEO-L4R5ZI\Examples\FLASH\FLASH_WriteProtection?

Please let me know if the same problem is faced with these 2 methods as well?

-Amel

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.