cancel
Showing results for 
Search instead for 
Did you mean: 

Locking micro to prevent download of code

Ricko
Senior II

Hi,

where do you set programmatically (perhaps through a preprocessor directive) the option to lock the micro to prevent read/download of the flashed code but while obviously still allow for firmware updates?

Also I could not seem to find any such option in CubeIDE. Is it available there or do I need to use the CubeProgrammer?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
BarryWhit
Lead II

Use CubeProgrammer's Option Byte pane to set RDP options (Readout Protection). Make sure to carefully read up on this feature first, so you don't hurt yourself. Setting RDP level 2 is irreversible.

 

Update: here's another pitfall story, of a near-brick even with RDP level 1.

 

Update2: 

AN5347: Arm® TrustZone® features for STM32L5 and STM32U5 Series

does a good job of scaring you with brick scenarios.

 

 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

View solution in original post

3 REPLIES 3

Simpler perhaps to engage writing of Option Bytes in your own code, and either engage automatically based on a check if currently locked in RDP, or command initiated via your user interface, along with mass erase to clear RDP1

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BarryWhit
Lead II

Use CubeProgrammer's Option Byte pane to set RDP options (Readout Protection). Make sure to carefully read up on this feature first, so you don't hurt yourself. Setting RDP level 2 is irreversible.

 

Update: here's another pitfall story, of a near-brick even with RDP level 1.

 

Update2: 

AN5347: Arm® TrustZone® features for STM32L5 and STM32U5 Series

does a good job of scaring you with brick scenarios.

 

 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.
Ricko
Senior II

Thank you both.