jsnyder / stm32loader

Python script to load firmware using STM32 bootloader
324 stars 238 forks source link

cmdEraseMemory(): fix incorrect crc calculation #4

Open liamstask opened 9 years ago

kuraga commented 7 years ago

@jsnyder is this correct?

florisla commented 6 years ago

Basically, this includes N (the number of pages) in the checksum whereas previously it would include value 0xFF instead, which would only be correct for N=255, which is impossible because that's reserved for global erase.

ST application note 3155 says "((...) checksum XOR (N, N+1 bytes))" so this seems to be correct now.