1 Commits

Author SHA1 Message Date
05d0ff0576 stc12+: drop checksum verification for flashing
It's not needed on STC12 and up. All transfers are error checked with
parity and a 16-bit modular sum already. STC15 dropped the verification
checksum on the protocol level, it's not sent with the write status
packet, which is a testament to it being useless.

Some parts store the UID in the last bytes of flash memory and this
verification actually caused incorrect verification failures because
of that.

Fixes grigorig/stcgal#15.
2016-05-26 12:53:02 +02:00

View File

@ -1293,7 +1293,7 @@ class Stc15Protocol(Stc15AProtocol):
# This is a bit of a hack, but it works.
bauds = self.baud_transfer if (self.mcu_magic >> 8) == 0xf2 else self.baud_transfer * 4
packet += struct.pack(">H", int(65535 - program_speed / bauds))
packet += bytes(user_trim)
packet += struct.pack(">H", int(65535 - (program_speed / bauds) * 1.5))
iap_wait = self.get_iap_delay(program_speed)
packet += bytes([iap_wait])
self.write_packet(packet)