• AVR Freaks

Hot!ATECC608A trouble with I2C

Author
esanchez
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/03/04 11:01:08
  • Location: 0
  • Status: offline
2019/03/04 14:43:31 (permalink)
0

ATECC608A trouble with I2C

Hi, 
 
I'm having trouble communicating with the ATECC608A through I2C and I'm not sure if my issue is hardware or software.
I'm using the cryptoauthlib to initialize the chip and to grab a random number like this:
 
     atcab_init(&cfg_ateccx08a_i2c_default); //I2C interface
     atcab_random(&random_number); // get a random number from the chip
 
The problem is that I always get a status response of ATCA_TOO_MANY_COMM_RETRIES, and from my analyzer trace, it looks like the ATECC608A never ACKs anything. I can see the library tries to wake up the chip by writing 0x00 and then waits ~1.9ms and performs a twi_master_read() to address 0xC1 to see if the device woke up, but this always fails for me.
 
Is the I2C address of 0xC0 correct for the ATECCC608A? Should I be getting an ACK like any other I2C device? 
 
Thank you
#1

5 Replies Related Threads

    esanchez
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/03/04 11:01:08
    • Location: 0
    • Status: offline
    Re: ATECC608A trouble with I2C 2019/03/05 09:42:03 (permalink)
    4 (1)
    I think I found my issue. It looks like I have the 1-Wire version of this chip instead of the I2C version. My part number is ATECC608A-SSHCZ-T, where the "CZ" indicates 1-Wire according to the "Product Identification System" on the datasheet.
    #2
    JavierPascual
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/05/10 01:52:33
    • Location: 0
    • Status: offline
    Re: ATECC608A trouble with I2C 2019/05/20 10:27:24 (permalink)
    0
    Hi!
     
    I have a problem with the ATECC608A running with a ESP32. I think it's a bug of the library. I have the I2C version and it's detected correctly (with i2c scanner), but always return error 240 (atcab_read_bytes_zone() failed with ret=0x000000F0).
     
    ATCAIfaceCfg *gCfg = &cfg_ateccx08a_i2c_default;
    ATCA_STATUS status = ATCA_GEN_FAIL;
    uint8_t random_number[32];
    uint8_t serial_number[9];
     
    gCfg->iface_type = ATCA_I2C_IFACE,
    gCfg->devtype = ATECC608A,
    gCfg->atcai2c.slave_address = 0x76;
    gCfg->atcai2c.bus = 1;
    gCfg->atcai2c.baud = 400000;
    gCfg->wake_delay = 1500;
    gCfg->rx_retries = 20;
     
    status = atcab_init(gCfg);
     
    if (status == ATCA_SUCCESS)
    {
       status = atcab_random(random_number);}
    else
    {
       ESP_LOGE(DEV_TAG, "\t- ERROR: %i", status);
    }
     
     
     
     
     
    post edited by JavierPascual - 2019/05/20 10:35:40
    #3
    esanchez
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/03/04 11:01:08
    • Location: 0
    • Status: offline
    Re: ATECC608A trouble with I2C 2019/05/23 13:20:05 (permalink)
    0
    Where do you get the error? Inside atcab_init() or inside atcab_random()?
     
    Did you #define ATCA_HAL_I2C and ATCA_NO_HEAP?
     
    My configuration is this:
    ATCAIfaceCfg cfg_ateccx08a_i2c_default = {
    .iface_type = ATCA_I2C_IFACE,
    .devtype = ATECC608A,
    .atcai2c.slave_address = 0xC0,
    .atcai2c.bus = 1,
    .atcai2c.baud = 400000,
    //.atcai2c.baud = 100000,
    .wake_delay = 1500,
    .rx_retries = 20
    };
     
    atcab_init(&cfg_ateccx08a_i2c_default);
     
     
    My call to atcab_init() returns success but for some reason when I call atcab_random(), the ATECC608A always sends the same value of 0xFF00...FF00 and the call also returns success. I'm sort of stuck trying to get a random number.
     
    #4
    JavierPascual
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/05/10 01:52:33
    • Location: 0
    • Status: offline
    Re: ATECC608A trouble with I2C 2019/05/23 14:20:33 (permalink)
    0
    I have not defined ATCA_NO_HEAP (ATCA_HAL_I2C yes), i'm going to try it...
     
    The error is returned by atcab_init().
     
    About the "baud" config, inside the cryptoauthlib always is setted to 100000 bauds (ignore user parameter).
     
    Thanks!!
    #5
    JavierPascual
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/05/10 01:52:33
    • Location: 0
    • Status: offline
    Re: ATECC608A trouble with I2C 2019/05/24 14:37:39 (permalink)
    0
    It fails with ATCA_NO_HEAP defined too... :-(
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5