Skip to content

Commit

Permalink
README.md: Add note about write protected flash. Fixes #545
Browse files Browse the repository at this point in the history
  • Loading branch information
xor-gate committed Jan 28, 2017
1 parent bf1b81b commit 0f9e499
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,37 @@ of the flash:

Issue related to this bug: [#356](https://github.com/texane/stlink/issues/356)

### Flash size is detected as zero bytes size

It is possible that the STM32 flash is write protected, the st-flash tool will show something like this:

```
st-flash write prog.bin 0x8000000
2017-01-24T18:44:14 INFO src/stlink-common.c: Loading device parameters....
2017-01-24T18:44:14 INFO src/stlink-common.c: Device connected is: F1 High-density device, id 0x10036414
2017-01-24T18:44:14 INFO src/stlink-common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in pages of 2048 bytes
```

As you can see, it gives out something unexpected like
```
Flash: 0 bytes (0 KiB) in pages of 2048 bytes
```

```
st-info --probe
Found 1 stlink programmers
serial: 303030303030303030303031
openocd: "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31"
flash: 0 (pagesize: 2048)
sram: 65536
chipid: 0x0414
descr: F1 High-density device
```

Try to remove the write protection (probably only possible with ST Link Utility from ST itself).

Issue related to this bug: [#545](https://github.com/texane/stlink/issues/545)

## Contributing and versioning

* The semantic versioning scheme is used. Read more at [semver.org](http://semver.org)
Expand Down

1 comment on commit 0f9e499

@jeroavf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi , I had success unlocking stm32 bluepills using the following commands on openocd terminal session:

reset halt
flash banks
stm32f1x mass_erase 0
stm32f1x unlock 0

After that, the device was ready to be programmed again.

Please sign in to comment.