raspberrypi / rp2350_hacking_challenge

130 stars 7 forks source link

PAGE_LOCKS are not ECC #3

Open polhenarejos opened 2 months ago

polhenarejos commented 2 months ago

From the datasheet:

Lock bits in OTP are triple-redundant with a majority vote. They can’t be ECC-protected, because they may be mutated bit-by-bit over multiple programming operations.

which makes sense.

But in the main.c code, ECC is used to lock the page 48, albeit 3 bytes are provided (which is clearly raw). If it is ECC, only 2 bytes should be provided.

https://github.com/raspberrypi/rp2350_hacking_challenge/blob/bb76472ff3e5d688452facc78e98de21bf1908d9/main.c#L35

If I understood correctly, OTP_CMD_ECC_BITS should not be used.