2025-04-30 10:22 AM - last edited on 2025-05-01 12:28 AM by Andrew Neil
Hello everyone, please advise, I encountered difficulties when removing and installing memory read protection when programming h503 via the built-in UART bootloader.
I use commands {0x92, 0x6D} to remove read protection and {0x82, 0x7D} to install read protection. On F103 these functions work correctly, on h503 they do not.
At the same time, on 503, memory erase, ID reading and programming operations work correctly, the h503 microcontroller is flashed and after rebooting the new program takes effect.
Perhaps I am sending incorrect read protection codes? Or is my mistake in something else?
2025-04-30 12:29 PM
Use the GET COMMAND command to see which commands are supported.
The H5 does not have a RDP HW feature.
2025-04-30 8:54 PM
Thank you for your answer, sorry to hear this.. Maybe you have a solution on how to set read protection directly from the application?
2025-05-01 5:53 AM
The STM32H5 doesn't have legacy RDP, it has product states which are significantly more complicated. There isn't a product state that is equivalent to RDP 1. So you can't do that.
I suggest looking at your options in the reference manual. You can apply these via option bytes the same way you would apply RDP 1 on the older chips.
Also see:
How to enable RDP-like product state flash protect... - STMicroelectronics Community
2025-05-03 6:29 AM
Thank you for your answer, do you have any example of how to control OB directly from the application? And will it be possible to load a new program via UART with saving user data in the last sector of flash memory?
2025-05-03 10:09 AM
Here is one project which modifies option bytes with the HAL_FLASHEx_OBProgram function.