Skip to main content
Aurelien1
Associate III
October 5, 2022
Solved

How to process RDP regression from appplication code?

  • October 5, 2022
  • 4 replies
  • 2241 views

Hi,

for my application I need to set RDP regression from my application code :

1) Is it possible in RDP2 to provide OEM Key (for regression) from application code in order to restore JTAG access (and perform a regression whith a user intervention)

2) Is it possible to do RDP 2 => RDP 1 from application code (using DBGMCU_DBG_AUTH_DEVICE or other way) ? if yes what is the correct process

3) is it possible to go from RDP 1 to RDP 0 or RDP 0_5?

for this part I try the following code without success (no error but no RDP Regression)

 FLASH_OBProgramInitTypeDef obConfig = {0};

 HAL_FLASH_Unlock();

 HAL_FLASH_OB_Unlock();

 obConfig.RDPKey1 = 0x11111111;

 obConfig.RDPKey2 = 0x11111111;

 obConfig.RDPKeyType = OB_RDP_KEY_OEM1;

 obConfig.OptionType = OPTIONBYTE_RDPKEY;

 HAL_FLASHEx_OBProgram(&obConfig);

 obConfig.RDPLevel= OB_RDP_LEVEL_0_5;

 obConfig.OptionType = OPTIONBYTE_RDP;

 HAL_FLASHEx_OBProgram(&obConfig);

 obConfig.RDPLevel= OB_RDP_LEVEL_0_5;

 obConfig.OptionType = OPTIONBYTE_RDP;

 HAL_FLASHEx_OBProgram(&obConfig);

 HAL_FLASH_OB_Launch();

Should I use HAL_FLASH_OB_Launch() twice ?(I will use external memory to store prvious command)

Thanks for your help

This topic has been closed for replies.
Best answer by Jacob WOODRUFF

Hi Aurelien,

This thread was flagged for a case creation by one of our community moderators but I see that a case has already been created and closed from our direct support team.

For the benefit of everyone else that may have similar issues, the expertise from our team is given below:

"

RDP regression ( in legacy mode ) is possible from embedded software.

But in your code, you try to provision the OEM1 key then do a regression.

The rule about key provisioning is explained in this video:

https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/stm32u5-rdp.html

https://www.youtube.com/watch?v=9Im5h5hJACM&list=PLnMKNibPkDnEkeKd_fytwc_9x2Ht2gRUn&index=2

at 6.20

"

Regards,

Jake

ST Support

4 replies

Tesla DeLorean
Guru
October 5, 2022

Isn't RDP=2 PERMANENT ?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Aurelien1
Aurelien1Author
Associate III
October 5, 2022

Not in my case . I don't lock RDP_2 (OEM2LOCK = 1) to allow RDP regression using OEM Key.

Aurelien1
Aurelien1Author
Associate III
October 7, 2022

Does it is possible to access to DBGMCU_DBG_AUTH_HOST from application code?

I see that this register is not inside the HAL

Jacob WOODRUFFBest answer
ST Employee
November 10, 2022

Hi Aurelien,

This thread was flagged for a case creation by one of our community moderators but I see that a case has already been created and closed from our direct support team.

For the benefit of everyone else that may have similar issues, the expertise from our team is given below:

"

RDP regression ( in legacy mode ) is possible from embedded software.

But in your code, you try to provision the OEM1 key then do a regression.

The rule about key provisioning is explained in this video:

https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/stm32u5-rdp.html

https://www.youtube.com/watch?v=9Im5h5hJACM&list=PLnMKNibPkDnEkeKd_fytwc_9x2Ht2gRUn&index=2

at 6.20

"

Regards,

Jake

ST Support