2021-03-05 02:30 AM
Hi!
There is an issue with unlocking the EEPROM on STM8 (probably all of them, but I am using STM8L151).
This article summarizes the issue very well: https://slime.systems/content/stm8-eeprom-bug/
There it says it was first found in 2013, and here we are 8 years later - on my board with an STM8L151K6 I found this super tricky bug that "sometimes" the EEPROM does not unlock for some reason.
I went a bit through the same thinking as the author of the article above, thinking that maybe I got the key order wrong since it kinda worked one out two times (kinda). But changing the order was not working everytime... Anyways I love his solution - simple, and it works!
I just wanted to mention it here hoping that one day someone from ST will have a look and at least mention it in the manuals or the errata.
Simon