New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atecc_csr.py fails #28
Comments
After running the code I tried running it again and get the following output:
|
@evaherrada After attempting to run the CSR example if you set lock=True the chip becomes permanently locked with the settings in the configuration portion of the script. This should come with an extreme warning as it's permanent. Once the chip is configured and eeprom locked it can never be unlocked or reconfigured.Immediately after locking the chip it will only respond to a wakeup ping. Then and ONLY then will the I2C address reappear and connect for communication (takes milliseconds). If you do not send it a wakeup ping the I2C device will appear as if it's completely gone with the Part of the security of this chip is that it can be programmed with any I2C address of your choosing. 0x60 is just the default address. You must know the exact I2C address to send the wakeup ping to... it will not show itself in a conventional I2C scan. So the Once locked the ATECC I2C address doesn't exist unless first pinged with a wakeup command, then the I2C address will magically appear and you can communicate with the module. This is completely outside the normal operation we're accustomed to in Circuit Python with I2C devices. ATECC_Wakeup.mp4I have yet to figure out more but I hope that sheds some light on what I've learned about this chips behavior. So far I haven't been able to get it to produce a certificate once. Most of the issues I believe are simply timing related. This chip is extremely temperamental about precise timing for reading & writing commands. The way the chip behaves prior to locking the configuration is different than after you lock it. Prior to locking it will respond like any normal I2C device. The 0x60 address is always available and ready to play nicely. Afterwards it turns into something different. |
Traceback (most recent call last):
File "code.py", line 52, in <module>
File "/lib/adafruit_atecc/adafruit_atecc.py", line 192, in __init__
File "/lib/adafruit_atecc/adafruit_atecc.py", line 264, in version
File "/lib/adafruit_atecc/adafruit_atecc.py", line 218, in idle
OSError: [Errno 19] No such device Triple quote comment out this section of code on line 192 of adafruit_atecc.py """
if (self.version() >> 8) not in (_ATECC_508_VER, _ATECC_608_VER):
raise RuntimeError(
"Failed to find 608 or 508 chip. Please check your wiring."
)
""" It will now pass outside of the library and run code.py! i2c = busio.I2C(board.SCL, board.SDA, frequency=70000)
atecc = ATECC(i2c_bus=i2c, debug=False)
print("WE MADE IT OUT OF THE LIBRARY LOOP!")
# Initialize the SHA256 calculation engine
atecc.sha_start() However it immediately runs into the next error which is sha_start related. code.py output:
WE MADE IT OUT OF THE LIBRARY LOOP!
Traceback (most recent call last):
File "code.py", line 55, in <module>
File "/lib/adafruit_atecc/adafruit_atecc.py", line 417, in sha_start
File "/lib/adafruit_atecc/adafruit_atecc.py", line 604, in _send_command
OSError: [Errno 19] No such device
Code done running. This is progress. I can at least verify that the wake ping is working, the device wakes up, I2C address works, and the module responds. |
Tested on a Feather RP2040
The text was updated successfully, but these errors were encountered: