pyocd / pyocd/pyOCD

STM32 write to read-out protection option bytes

Open
#1,689 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pyocd flash command and STM32L011F4UX target support, then compare the reported RDP 0xBB failure with the STM32CubeProg reset to 0xAA. Done means pyOCD can write the relevant option bytes and the target can be flashed again; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.