I gave up on STM8L101 devices for the time being. According to [RM0013 Reference manual STM8L001xx and STM8L101xx microcontroller families, table 6, footnote 3](http://www.st.com/content/ccc/resource/technical/document/reference_manual/73/41/6f/b1/fd/45/4e/18/CD00184503.pdf/files/CD00184503.pdf/jcr:content/translations/en.CD00184503.pdf) STM8L10x devices must be reset after a Flash unlock/lock activity:
```
The Flash program memory is write protected (locked) until the correct MASS key is written in the FLASH_PUKR. It is possible to lock the memory again by resetting the PUL bit in the FLASH_IAPSR register. Unlocking can only be done once between two resets.
```
Fact is that STM8FLASH doesn't work with STM8L101 devices (e.g. STM8L001). I did quite some research, and traced the interactions between the ST-LINK V2 dongle and STM8FLASH. I also filed an STM8FLASH issue on GitHub, but I didn't get any response from the author or the community. I even checked the flash IAP routines in ST's STM8L library (there aren't any). The STM8L05x family enjoys much better support!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
hi.i just tried the raw chip. it seems to flash when power and programmer power are present. its possibly to do with the delay that needs to be there with the circuit power before the programmer uses swim. this definitely works on stm8flash. ive created a win vm with cosmic and got an error in there that led me to try this.
Are you sure? yes | no
Hi - thanks for the info! It's been a while since I tried flashing an STM8L001J3. Which version of STM8FLASH did you use?
Are you sure? yes | no
it's version 20170616-1.1
Are you sure? yes | no
Strange - 2017 versions didn't work for me. What kind of programmer do you use (e.g. STLINK V2 clone, Discovery board, a genuine ST Link adapter)?
Are you sure? yes | no
I'm using the genuine st link v2.
Are you sure? yes | no