Close

STM8L001J3: STM8FLASH

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

thomasThomas 01/14/2018 at 22:025 Comments

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

icraftcrafts wrote 06/21/2018 at 12:45 point

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

Thomas wrote 06/21/2018 at 16:54 point

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

icraftcrafts wrote 06/22/2018 at 05:46 point

it's version 20170616-1.1

  Are you sure? yes | no

Thomas wrote 06/23/2018 at 11:38 point

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

icraftcrafts wrote 06/25/2018 at 11:40 point

I'm using the genuine st link v2.

  Are you sure? yes | no