2026-04-14 12:03 PM - last edited on 2026-04-14 1:15 PM by mƎALLEm
Hello,
I am working with the STM32H745 using a Lauterbach TRACE32 debugger and i am evaluating ways to control Readout Protection (RDP).
I am able to configure RDP levels using STM32CubeProgrammer, however I would like to achieve the same using a TRACE32 (.cmm) script, without relying on the ST programmer.
Is there any recommended or reference TRACE32 PRACTICE (.cmm) script for setting and reverting RDP levels (Level‑0 to Level‑1) and (Level‑1 to Level‑0) on STM32H7 devices? I could not find any official examples demonstrating direct RDP control using .cmm script.
Is it supported or recommended to control RDP level changes from firmware on STM32H745? While setting RDP from Level‑0 to Level‑1 is possible, reverting from Level‑1 to Level‑0 results in a mass erase.
When reverting RDP from Level‑1 to Level‑0, is the mass erase automatically triggered by the hardware as part of the RDP regression, or is there an additional register or command that must be explicitly programmed to initiate the mass erase?
Thank you.
Solved! Go to Solution.
2026-04-14 1:27 PM - edited 2026-04-14 1:27 PM
Hello,
1- There is no official reference or recommended TRACE32 PRACTICE (.cmm) script provided by ST.
2- Please refer to the knowledge base article: How to change the Read Out Protection on STM32H7
3- The RDP regression from level 1 to level 0 the mass erase is automatically performed by hardware. This is the condition described in the reference manual RM0399:
Hope that helps.
2026-04-14 1:27 PM - edited 2026-04-14 1:27 PM
Hello,
1- There is no official reference or recommended TRACE32 PRACTICE (.cmm) script provided by ST.
2- Please refer to the knowledge base article: How to change the Read Out Protection on STM32H7
3- The RDP regression from level 1 to level 0 the mass erase is automatically performed by hardware. This is the condition described in the reference manual RM0399:
Hope that helps.
2026-04-15 10:25 PM
Hello,
Thankyou for your reply.
I am working on a custom hardware board based on the STM32H745, and STM32CubeMX / STM32CubeProgrammer is not used in my setup. The article How to change the Read Out Protection on STM32H7 demonstrates RDP level changes using the CLI‑based STM32CubeProgrammer, which is not applicable in my case.
In my scenario, I intend to control the Read‑Out Protection (RDP) level directly from firmware logic by programming the Flash option bytes at runtime.
Could you please confirm:
Whether RDP level control via firmware(software) logic (without external programmer tools) possible.
If supported, i want to know the exact and recommended sequence to:
1) Change RDP from Level‑0 to Level‑1
2) Change RDP from Level‑1 back to Level‑0
3) Is MCU required to be in a reset state or anyother state to modifty the RDP levels.
4) When mass erase is issued, whole flash memory will be erased?
2026-04-16 2:13 AM
@Firmsol wrote:
The article How to change the Read Out Protection on STM32H7 demonstrates RDP level changes using the CLI‑based STM32CubeProgrammer, which is not applicable in my case.
I think you didn't read the article carefully. Please read again the section 3. Coding
@Firmsol wrote:
4) When mass erase is issued, whole flash memory will be erased?
As stated in my previous post, that question has been answered in this section in the reference manual:
If you need an explanation of that section you need to open a new post because that's a new question and close this one.
Thank you.