Ballisticgel.py

Hello. I believe the following sequence of code taken from raw_test_compare() in ballisticgel.py has a bug, as it mixes up sets and resets. For example, if self.data[i] = 3 and din[i] = 255, we should have 6 set errors since 6 bits flipped to 1 after corruption. However, the code reports 6 reset errors. Please let me know if you agree.

 if self.data[i] != din[i]:
          diff = self.data[i] ^ din[i]
          errorlist.append(bin(diff).count('1'))
          set_errors.append(bin(diff & self.data[i]).count('1'))
          reset_errors.append(bin(diff & ~self.data[i]).count('1'))

Hi,

Good catch. I’ll get that fixed up.

Thanks

Hello,

As a follow-up, I noticed that the ‘errorlist’ for raw_test_compare() and seed_test_compare() appear to be different. In raw_test_compare(), each value in errorlist represents the number of bit differences between the written byte and the corrupted byte, and the entire length of this list is equal to the amount of bytes corrupted.

However, this does not appear to hold for errorlist generated from seed_test_compare(). In seed_test_compare(), the errorlist is of length 4194304 (SRAM size). Each value within this list seems to contain information about the difference between the original byte and the corrupted byte–what exactly is this information? Is it original byte XOR corrupted byte?

Thanks in advance!

Hi,

I’ve just pushed some updates and a new firmware update. raw_test_compare() now works the same as seed_test_compare() - errorlist is just the original byte XOR the corrupted (or not corrupted) byte.

raw_test_compare() should also now be roughly as fast as seed_test_compare().

Alex