PEmicro's development tools and production programmers support life-cycle management with readout protection (RDP) on STM32C5 devices. This article explains the STM32C5 security model and walks through provisioning regression passwords and performing RDP regression using PROGACMP and related PEmicro utilities. Tool support note: PEmicro tools support OEMKEY-based RDP regression from RDP2 to RDP0. Boundary scan operations are not currently supported — this includes the BSKEY transition from RDP2 with boundary scan to RDP2, and OEMKEY regression from the RDP2 with boundary scan state. If you use PEmicro tools for life-cycle management, plan to transition directly between RDP0 and RDP2. For background on STM32 families that support OEM-password RDP regression, see our earlier article on [STM32U-series RDP regression]. The STM32C5 workflow is similar, but there are important differences in RDP levels, key sizes, and tool configuration that are covered below. The STM32C5 series introduces a simplified but hardened product life cycle focused on secure boot and password-protected regression. Unlike many other STM32 families, the STM32C5 does not have an RDP level 1. The device operates in one of three readout protection states set by the RDP value in the FLASH_OPTSR option byte. The following states are listed below with their correlating RDP values: The STM32C5 device supports two password keys, provisioned while the device is in RDP0: For full technical details, refer to: - [ST Wiki: How to set the RDP password keys and levels on STM32C5 MCUs] - [ST Wiki: Getting started with STM32C5 security] - [RM0522 STM32C5 Series Reference Manual] — Chapter 3, Product Life Cycle Unlike the STM32CubeProgrammer approach described on the ST wiki, PEmicro tools configure the regression password through option bytes using a user options (`.OPT`) file. In PROGACMP, use CM (Choose Module) to load the option bytes algorithm for your target STM32C5 device. Select CU (Create/modify user options file) to open the option bytes configuration window. Scroll to the security key registers for your device. On STM32C5, configure the OEMKEY registers (four 32-bit values comprising the 128-bit key). The workflow is the same as for other STM32 families; the register names differ on STM32C5. Enter your desired password values as hexadecimal register contents. For example, a 128-bit OEMKEY of 00112233445566778899AABBCCDDEEFF would be programmed across four 32-bit registers: Save the configuration to a `.OPT` file. The screenshot below shows the configuration window for the OEM1KEY, OEM2KEY, OEM3KEY, and OEM4KEY registers: 1. Select SU (Specify user option files) and choose the `.OPT` file you created. 2. Select PU (Program User Options) to write the option bytes to the device. 3. Select LO (Launch Options) to load the configuration. Note: `FLASH_OEMKEYR` and `FLASH_BSKEYR` always read as zero, so VU (Verify user options) cannot confirm the key values. After setting and launching the OEMKEYS, the next step is to program the RDP level. Select CU (Create/modify user options file) again to create an RDP specific option byte configuration. Set the RDP value to 0x72 and save the new `.OPT` file. Repeat the same steps above to program the user options except with the RDP option bytes. Once the LO (Launch Options) command is run, the target will lose connection as it is now debug secured. Regression on STM32C5 is a single-step process: RDP2 → RDP0, conditioned on the correct OEMKEY and a full mass erase. This is simpler than the STM32U workflow, which may require an additional step to move from RDP level 1 to RDP level 0. To perform regression with PROGACMP: 1. Close PROGACMP completely and reopen it to return to the Connection Manager. This is required to access the security settings for regression. 2. In the Connection Manager, select your STM32C5 target device. 3. Open Security settings and enter the OEMKEY password (128-bit value) in the password field. 4. Enable the Mass erase upon connection to target checkbox. Regression performs a full flash mass erase, so this option must be selected. Security settings with OEM key password and "Mass erase upon connection to target" enabled. Shown here on PROGACMP Connection Manager; the same security settings are available in the Cyclone Image Creation Utility Power & Communications tab when STM32C5 is selected. For SAP images, the STM32C5 target only needs a power on reset to proceed with the regression. With the security settings and mass erase option configured, connect to the target under reset (or run a SAP image with the same settings on a Cyclone programmer). Per RM0522, the 128-bit OEMKEY is shifted through JTAG/SWD under reset as four 32-bit words into the debug authentication register. Upon a successful connection with the correct key, hardware launches the regression sequence and flash memory is mass-erased. On STM32C5, no additional user commands are needed after connection — the regression from RDP2 to RDP0 completes in a single step when the OEMKEY is correct. Apply a power-on reset after successful regression (cycle VDD off and on) before further debug or programming operations, as required by RM0522. If there is a failure connecting with to the target (i.e. $0007 error), then perform a power-on reset before retrying the regression. For production programming with a Cyclone, the same security settings apply on the Power and Communication tab of the Image Creation Utility: 1. Select the STM32C5 target device. 2. Open Security settings and enter the OEMKEY password. 3. Enable Mass erase upon connection to target. 4. Build and run the SAP image. If regression fails for any reason: If regression continues to fail, double-check that the OEMKEY was provisioned before the device was set to RDP2. A device closed to RDP2 without a provisioned OEMKEY cannot be recovered. PEmicro tools provide a workflow for STM32C5 life-cycle management — from provisioning the OEMKEY regression password through option bytes, to closing the device at RDP2, to recovering it with password-protected regression from RDP2 to RDP0 — without requiring STM32CubeProgrammer. Boundary scan life-cycle operations are outside the scope of PEmicro tool support. - [PEmicro Blog: STM32U RDP Regression (post 374)] - [ST Wiki: RDP password and regression on STM32C5] - [ST Wiki: Getting started with STM32C5 security] - [RM0522 — STM32C5 Series Reference Manual (PDF)]STMicroelectronics: Securing and Recovering STM32C5 Devices with RDP Regression
STM32C5 Security Background
RDP State Value Debug Access RDP0 (open) 0xED Full debug access RDP2 with Boundary Scan 0xD1 Boundary scan only; OEMKEY can regress to RDP0 (not supported by PEmicro tools) RDP2 (closed) 0x72 No debug access; OEMKEY can regress to RDP0 (supported by PEmicro tools) 
Important warnings
How to Program the OEM Password with PEmicro Tools
Step 1: Load the option bytes algorithm
Step 2: Create the user options file
Register Value OEMKEYR1[31:0] 0x00112233
OEMKEYR2[63:32] 0x44556677
OEMKEYR3[95:64] 0x8899AABB
OEMKEYR4[127:96] 0xCCDDEEFF
Step 3: Program the user options
Step 4: Set the RDP level
How to Regress the RDP Level with the OEM Password
Configure security settings in the Connection Manager
Connect to perform regression
Using Cyclone Image Creation Utility
Troubleshooting
Summary
Task PEmicro Tool / Command Key Requirement Provision OEMKEY CU → SU → PU → LO Device must be in RDP0 Set RDP level RP (Read Protection) — Regress RDP2 → RDP0 Connection Manager security settings + connect under reset Correct OEMKEY, mass erase enabled After successful regression Power-on reset target Required by RM0522 before further use Recover from failed attempt Power-cycle target then retry One unlock attempt per power cycle References