rumpeltux .

STM8: set NUBC after disabling readout protection, to be able to flash again

Discussion created by rumpeltux . on Jan 18, 2018

After disabling readout protection, everything is set to 0x00, including the option bytes including the inverted option bytes (i.e. these values are not equal to the factory default as mentioned in the datasheet).

Apparently (at least for my stm8s103f3), flashing then fails, but it turns out this can be fixed by writing NBUC=0xFF first.

This means that the UBC value (if inconsistent) is not evaluated to 0 as it should be according to datasheet descriptions.