cancel
Showing results for 
Search instead for 
Did you mean: 

RDP of STM32G0B1xB/xC/xE

aki49
Associate II

Hello .

According to the reference manual, the default RDP level is set to level 1. However, after performing a full erase with ST-Link and then writing the hex file, the RDP level was found to be set to 0.

I would like to set the RDP level to 1 at the stage of writing the hex file with ST-Link without using software to control the registers. Could you please tell me how to do this?

Best regards,  

aki

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @aki49 

yes option byte could be modified from embedded software and you can use HAL do do this.

Please find link related to this topics
https://community.st.com/t5/stm32-mcus/how-to-program-stm32-option-bytes-with-the-hal-api/ta-p/49660
https://community.st.com/t5/stm32-mcus-products/flash-rdp-activate/td-p/568517

 

Best regards,

Frantz 

View solution in original post

4 REPLIES 4
Frantz LEFRERE
ST Employee

Hell @aki49 ,

a you can read in the reference manual 
https://www.st.com/resource/en/reference_manual/rm0444-stm32g0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

page 81/1390
User and read protection option bytes
Flash memory address: 0x1FFF 7800
Reset value: 0xFFFF FEAA (ST production value)

So default value of RDP = 0xAA which is RDP level 0.

You can modify the option byte could be change thanks programming tools like STM32CubeProgrammer.

FrantzLEFRERE_0-1709274730475.png

You can modify it in command line :

cd "\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin"

STM32_Programmer_CLI.exe -c port=SWD mode=UR -ob RDP=0xBB

If you are using an other programming tools, you probably have interface to change option byte.

Best regards,

Frantz

 

 

Hello Frantz LEFRERE,

 

Thank you for your reply.

I misunderstood the default values and understood that it is possible to rewrite using STM32CubeProgrammer.

It seems that changes can also be made through software processing without using STM32CubeProgrammer.

If there are any sample programs available, could you please let me know?

 

Thank you in advance.

aki

Hello @aki49 

yes option byte could be modified from embedded software and you can use HAL do do this.

Please find link related to this topics
https://community.st.com/t5/stm32-mcus/how-to-program-stm32-option-bytes-with-the-hal-api/ta-p/49660
https://community.st.com/t5/stm32-mcus-products/flash-rdp-activate/td-p/568517

 

Best regards,

Frantz 

aki49
Associate II

Hello @Frantz LEFRERE 

I was able to resolve my issue.

I want to express my gratitude for the valuable information you provided.It was very helpful.

 

Best regards,

aki49