cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S207RBT6 - write protected

CNone.1
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
CNone.1
Associate

Thanks, you solved my problem!