# How to flash protected STM8 MCU?

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?

• If you want to update the firmware, you don't need to download the hex, you need to upload it. – Keelan Sep 12 '14 at 13:49
• @Camil Right. I find this somehow confusing as well but some tools call the process of copying a hex file from the development machine to the MCU Download. I change my wording above. – Rolf Sep 12 '14 at 14:35

## 1 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.