Hello,
When writing eeprom part of flash of STC15W204S at 90% it says "error bad magic"
I figured the problem is that STCGAL doesn't fully erase all EEPROM sectors,
so I share my (adhoc) solution to this:
Change line 1742 of protocols.py, the part where it says
packet += bytes([0x01])
change it to:
packet += bytes([0x02])
so it forces erasure of all EEPROM sectors.
That's it!

Hello,
When writing eeprom part of flash of STC15W204S at 90% it says "error bad magic"
I figured the problem is that STCGAL doesn't fully erase all EEPROM sectors,
so I share my (adhoc) solution to this:
Change line 1742 of protocols.py, the part where it says
packet += bytes([0x01])
change it to:
packet += bytes([0x02])
so it forces erasure of all EEPROM sectors.
That's it!