Skip to main content
SReef.1
Visitor II
July 27, 2020
Question

How to write protect STM32L4RZI internal flash

  • July 27, 2020
  • 1 reply
  • 531 views

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!

This topic has been closed for replies.

1 reply

Amel NASRI
Technical Moderator
August 12, 2020

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 "Best Answer" on the reply which solved your issue or answered your question.