hello @Domy_ST
After setting PCROP for your desired memory area and ensuring both DMEP bits are cleared, the software in that area will continue to execute for the user during and after RDP regression. Only instruction fetches are allowed; all other access types are blocked, maintaining the security of your proprietary code.
the workflow to configure PCROP region:
- Define a dedicated executable section in the linker script.
- Place the code you want to protect into that section.
- Compile with the required flag: -mslow-flash-data
- Program the firmware.
- Activate the PCROP region using the flash protection configuration (STM32CubeProgrammer).
- make sure the DMEP bit is configured to 0 (unchecked)
PCROP Activation Rules
- If START > END, PCROP is deactivated
- If START < END, PCROP is activated
I would sugget to you to take a look at these references:
- Security Part 3: STM32 security features MOOC: link
- ST provides an expansion package for PCROP (X-CUBE_PCROP): link
B.R