required fix for circuit python 8.2.x ATECC crypto module#34
Conversation
wake frequency 100000 causes CRC Mismatch failure. setting frequency to 75000 works. confirmed on rp2040 feather and esp32-s3 feather.
|
Scratch that. This is not a fix. There are much more complicated issues happening here where the crypto module will get locked. Found an indication in a datasheet that it might happen after the first 128 uses which tracks with my use. I lost count around 113 and then it just stopped working. According to page 19 of the Atmel CryptoAuthLib Datasheet there needs to be a release but I'm not seeing a function for that in the library. I suspect the chip is being locked after 128 uses with no function to release/unlock it. Will continue to work on this. This commit is not ready for merging. |
|
I think it was just a coincidence that it was around 128 iterations until I attempted to use the CSR script and flipped the lock to =True. That's what configures the eeprom and then locks eeprom permanently. After being locked the device hides itself from normal I2C scans. It will only communicate when a wakeup ping of the correct I2C bus frequency and I2C address are sent to it. There are many issues with the current library. It's concerning that a warning of the danger of permanently locking the device is not documented on the Adafruit product page, in the learn guide, repo, or code commented in the CSR example. I will be submitting a new commit with a code comment warning of the severity of choosing lock=True. The simpletest fix does work but then people will immediately turn straight to the CSR example and likely end up locking their chip when they run into the |
|
The reason this should be added is because different MCU's can have different clock frequencies. The default frequency might not work for some boards while it might for others. By providing a way to set the frequency in the simpletest that should alleviate any clock disparities between boards and allow the user to figure out the best frequency to use with their board. |
Wake frequency 100000 causes CRC Mismatch failure. setting frequency to 75000 works. confirmed on rp2040 feather and esp32-s3 feather.
With default 100000 wake frequency
With frequency at 75000 wake frequency (any value from 1 to 79999 works)
The simpletest is broken on most if not all microcontrollers with the current stable 8.2.10 circuit python due to the default wake frequency being too high. I've added a code commented frequency if the default 100000 value doesn't work they'll have a code commented alternative to try.