Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 write to read-out protection option bytes #1689

Open
redfast00 opened this issue Apr 25, 2024 · 3 comments
Open

STM32 write to read-out protection option bytes #1689

redfast00 opened this issue Apr 25, 2024 · 3 comments

Comments

@redfast00
Copy link

Currently, I am failing to flash a stm32l011f4ux; the error I get is:

$ pyocd flash --target stm32l011f4ux bin/firmware.elf
0000414 I Loading /home/user/bin/firmware.elf [load_cmd]
0000545 C Memory transfer fault (read) @ 0x08000000-0x0800003f [__main__]

This is because the RDP (read-out protection) option byte is set to 0xBB. If I set this back to 0xAA (no protection) using STM32CubeProg, flashing is once again possible.

Is there a way to write to the option bytes of STM32 microcontrollers from pyOCD to be able to reset them to 0xAA, and be able to write to the chip again?

@ajaybhargav
Copy link

Did you find any solution?

@redfast00
Copy link
Author

Not from pyOCD, no :/ but I was able to clear them with STM32CubeProg

@ajaybhargav
Copy link

I did the same way. there is some kind of implementation done for STM32H series

def disable_read_protection(self):

But i don't think it applies to STM32F, but something on those lines can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants