Electronic – How to flash protected STM8 MCU

firmwarestm8

I would like to flash a new firmware on my STM8L15xC8. I have ST Visual Programmer (STVP) installed and can successfully flash the MCU of the STM8 Discovery board. Now, I setup the STM8 Discovery board to flash external applications. However, when I want to write to the MCU my hex file, I get the error The device is protected. What should I do?

Best Answer

Make sure that the Read Out Protection (ROP) byte is set to off. Open STVP, go to the OPTION BYTE tab, set ROP to off and write out (Ctrl + P). Then, go to the PROGRAM MEMORY tab again and you should be able to write your hex file.