wirenboard / atecc-util

Linux command-line tool for ATECC608A and ATECC508A
MIT License
40 stars 17 forks source link

commands fail with status f0 #7

Open bernardoaraujor opened 3 years ago

bernardoaraujor commented 3 years ago

I'm trying to use atecc-util under Debian for USB Armory MKII. It contains one ATECC608A under address 0x60.

$ sudo /usr/sbin/i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- 31 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 61 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

I compiled the project just fine (v0.4.3). However when trying to execute simple commands:

$ atecc -v       
atecc-util 0.4.3 (v0.4.3), build Dec 24 2020 00:51:50
$ atecc -b 0 -s 0x60 -c "info"
Attempts left: 3
Attempts left: 2
Attempts left: 1
Command atcab_info is failed with status f0
$ atecc -b 0 -s 0x60 -c "serial"
Attempts left: 3
Attempts left: 2
Attempts left: 1
Command atcab_read_serial_number is failed with status f0
rrottmann commented 3 years ago

-s 0xC0 needs to be used for i2c devices listening on 0x60. Also stumbled upon this as the i2c address gets derived from the configuration byte 16. Only 7 bits of this config byte are being used for the i2c address.