STM8S207RBT6 - write protected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-21 1:50 AM
Hello,
I have got an industrial PCB with a STM8S207RBT6. I'm able to READ programm memory, data memory and option bytes with ST Visual Programmer and STLink V2.
Also I can write data memory and option bytes. But if I try to write program memory I get an error:
"Programming failed. Device is write protected. Check by values."
But in by value I can't find anything about write protection. Only read out protection, which is turned off.
Option bytes are set to:
000102000000000000
Any advice for my problem?
Regards
Chris
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-21 5:08 AM
The datasheet of the STM8S207RBT6, section 8 (Option bytes) gives you some explanation of the option bytes.
Yes, ROP is disabled, but the remaining bytes do not completely match the datasheet, e.g.:
- byte 2 (OPT1, UBC) contains 0x01, which stands for Pages 0 to 1 defined as UBC, memory write-protected
- byte 3 (NOPT1, NUBC) contains 0x02, but should be the complement of byte 2, i.e. 0xFE
- byte 4 (OPT2, AFR) contains 0x00, which might be OK
- byte 5 (NOPT2) also contains 0x00, but should be the complement of byte 4, i.e. 0xFF
- etc
This section of the datasheet also describes how to perform a write to the memory.
Good luck!
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-21 5:08 AM
The datasheet of the STM8S207RBT6, section 8 (Option bytes) gives you some explanation of the option bytes.
Yes, ROP is disabled, but the remaining bytes do not completely match the datasheet, e.g.:
- byte 2 (OPT1, UBC) contains 0x01, which stands for Pages 0 to 1 defined as UBC, memory write-protected
- byte 3 (NOPT1, NUBC) contains 0x02, but should be the complement of byte 2, i.e. 0xFE
- byte 4 (OPT2, AFR) contains 0x00, which might be OK
- byte 5 (NOPT2) also contains 0x00, but should be the complement of byte 4, i.e. 0xFF
- etc
This section of the datasheet also describes how to perform a write to the memory.
Good luck!
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-21 7:20 AM
Thanks, you solved my problem!
