cancel
Showing results for 
Search instead for 
Did you mean: 

STM8L : why is the beginning of flash memory (0x8000 to 0x9200) erased/modified after power off ?(!)

JPani.1
Associate II

Hello,

When I flash a user application to STM8L with STVD, it works fine. As long as I do NOT power off MCU, I can read back flash content with STVP. For the first byte located at address 0x8000 (beginning of IT vector table), value is 0x82, which is normal.

But, if I disconnect USB cable and reconnect it, and if I read flash content with STVP, the data have been modified and the first byte is not 0x82 any more ! Moreover, it seems that most of data are 0 (not all of them) from address 0x8000 to 0x9200.

I replaced my user application by a simple one, let's say an "empty main function", and the issue is still there.

Any idea ? Thank you in advance for any help... :)

Julien

3 REPLIES 3
Philipp Krause
Senior II

Do you see the same problem when using stm8flash instead of STVD? What about writing with one and reading with the other?

JPani.1
Associate II

Hello Philipp,

Thank you very much for your help.

I was using SVTD & SVTP on Windows 10. I followed your suggestion and tried with stm8flash, which I installed on another laptop running Ubuntu : I flashed a s19 file and read back memory successfully after unplugging/plugging back the device through USB. So, flash content is not erased any more. Congratulations for your good suggestion. :)

However, if I flash the device through stm8flash on Ubuntu, and if I disconnect the device for plugging it to the laptop running SVTP on Windows 10, the flash is still corrupted at SVTP reading. Do you think that it is a SVTP problem or rather a specific Windows 10 issue ? (that's just a bonus question, stm8flash workaround is already a very good thing for me)

Julien

JPani.1
Associate II

PS : I did some others tests and it seems that memory corruption appears after a connexion to my laptop running Windows 10 (SVTP is not the problem). Weird, anyway... ^^

Thank you again for your help !

Best,

Julien