Hello. I believe the following sequence of code taken from raw_test_compare() in has a bug, as it mixes up sets and resets. For example, if[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[i] != din[i]:
          diff =[i] ^ din[i]
          set_errors.append(bin(diff &[i]).count('1'))
          reset_errors.append(bin(diff &[i]).count('1'))


Good catch. I’ll get that fixed up.



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!


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().