2026-04-09 6:13 AM - edited 2026-04-09 8:07 AM
This article provides a step-by-step guide explaining how to transition a development setup from STM32C5 + ST-LINK to STM32C5 + Segger J-Link. It focuses on the complete RDP life cycle and including RDP regression with password based on OEM keys.
This guide also showcases the setup for the NUCLEO-C542RC, NUCLEO-C562RE, and NUCLEO-C5A3ZG boards.
Hello developer, and welcome to this article. If you’re working with STM32C5 and planning to move from an ST-LINK–based setup to a J-Link–based setup, this article is for you! Here, we guide you through the full RDP life cycle, including OEMKEY provisioning, flashing your binary image, closing the chip, and finally performing the password-based RDP regression.
This article assumes prior knowledge of STM32C5 security. All these prerequisites are covered in the STM32C5 security wiki using STM32CubeProgrammer and the STLINK interface: How to set the RDP password keys and levels on STM32C5 MCUs
This article complements the wiki by focusing on the J-Link–based workflow and the specific steps required to manage RDP and OEM keys:
The Segger J-Link software version 9.32 or later is required.
You can download the J-Link software here: https://www.segger.com/downloads/jlink/
The J-Link software package contains several utilities. Two of them are used in this article:
On an STLINK setup, both powering the board and debug signals are provided through the STLINK connector.
On a J-Link setup, that is, with an external probe, the debug signals are available through the "External Debug Interface" of the board. Its power supply remains available through the STLINK interface with the 5V selector jumper set to STLINK.
The next three sections showcase the setup for the following boards:
https://www.st.com/resource/en/schematic_pack/mb2213-c542rc-b02-schematic.pdf
https://www.st.com/resource/en/schematic_pack/mb2213-c562re-b02-schematic.pdf
https://www.st.com/resource/en/schematic_pack/mb2213-c562re-b02-schematic.pdf
Note: Ensure that the MIPI‑20 ribbon cable is correctly oriented: the keyed notch on the connector must align with the key on the board header. Refer to the arrow at the bottom of the picture.
Once our setup is functional, the first thing to do is to provision the OEMKEY.
The OEMKEY has a 128-bit length (16 bytes).
In this article, the key used is: 00112233445566778899AABBCCDDEEFF.
Important note:
For all STM32C5 devices, the provisioning command to be executed is the same:
DevPro.exe -operation SetOEMKEY -SetConfigVal "Key=00112233445566778899AABBCCDDEEFF" -if SWD -speed 4000 -ScriptFile PCode_DevPro_ST_STM32C5.pex
Log output:
For all STM32C5 devices, the verify command to be executed is the same:
DevPro.exe -operation VerifyOEMKEY -SetConfigVal "Key=00112233445566778899AABBCCDDEEFF" -if SWD -speed 4000 -ScriptFile PCode_DevPro_ST_STM32C5.pex
Log output if successful:
Log output if the key is not the one provisioned:
To program our binary image, we use a .jlink file, named “flash_c5.jlink” that contains all the information needed by J-Link Commander.
The content of this file is:
loadfile C5-Software.bin, 0x08000000
Reset
Go
Exit
The available options are all here: https://kb.segger.com/J-Link_Commander#Commands
Execute the following command:
JLink.exe -device STM32C542RC -if SWD -speed 4000 -autoconnect 1 -CommandFile flash_c5.jlink
Execute the following command:
JLink.exe -device STM32C562RE -if SWD -speed 4000 -autoconnect 1 -CommandFile flash_c5.jlink
Execute the following command:
JLink.exe -device STM32C5A3ZG -if SWD -speed 4000 -autoconnect 1 -CommandFile flash_c5.jlink
Log output:
For all STM32C5 devices, the lock command to be executed to set the RDP level to 2 is the same:
DevPro.exe -operation SetRDP -SetConfigVal “Level=RDP2” -if SWD -speed 4000 -ScriptFile PCode_DevPro_ST_STM32C5.pex
Important note:
Log output:
In this article, the key used is: 00112233445566778899AABBCCDDEEFF.
For all STM32C5 devices, the unlock command to be executed to perform the RDP regression from Level 2 to Level 0 is the same:
DevPro.exe -operation Unlock -SetConfigVal "Key=00112233445566778899AABBCCDDEEFF" -if SWD -speed 4000 -ScriptFile PCode_DevPro_ST_STM32C5.pex
Important note:
Log output when successful:
Log output when the key is correct but a power-off / power-on cycle is missing: