GithubHelp home page GithubHelp logo

arduinouno-ateccx08a's People

Contributors

shinigami35 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

arduinouno-ateccx08a's Issues

GenKey command error with ATECC608A/B

Hello, I'm really sorry to bother you again, but I've encountered another issue while using the ATECC devices with the library. I've seen some people addressing this issue as well on the official repository, but none of those managed to find a fix to this.

Everything's working great so far, I can generate random numbers, read zones of different sizes, and every command tried so far works just fine.
Working code

However, whenever I try to generate a public key from a private key slot via GenKey command, a weird error happens:

  • If an ATECC608A is connected to the Arduino, the function returns error code F3 (ATCA_WAKE_SUCCESS)
  • If an ATECC608B is connected instead, the sketch stalls forever, like it's waiting for the device to provide the key

Error2
ATECC608A

Error
ATECC608B-TFLXTLS

This is the simple code I'm using:

#include  <Arduino.h>
#include  "ATECCX08A_Arduino/cryptoauthlib.h"

ATCAIfaceCfg  cfg;
ATCA_STATUS  status;
uint8_t  pubkey[64];

void  setup()
{
	Serial.begin(9600);
	
	cfg.iface_type = ATCA_I2C_IFACE; //I2C mode
	cfg.devtype = ATECC608A;
	cfg.atcai2c.slave_address = 0X6C; // I2C address 608A = C0, 608B = 6C
	cfg.atcai2c.bus = 1;
	cfg.atcai2c.baud = 100000;
	cfg.wake_delay = 1500; // Delay of wake up (1500 ms)
	cfg.rx_retries = 20;
}

//Simple print function. Nothing too fancy
void  printArray(uint8_t*  array, int  size){
	for (int  i=0; i<size; i++){
		Serial.print(array[i]);
	}
	
	Serial.println();
}

void  loop() {
	// put your main code here, to run repeatedly:
	status = atcab_init(&cfg);
	if (status == ATCA_SUCCESS){
		Serial.println("Init ok");
	} else {
		Serial.print("Init error. Code 0x");
		Serial.println(status, HEX);
	}

	status = atcab_get_pubkey(0, pubkey);
	if (status == ATCA_SUCCESS){
		Serial.print("PubKey generated from slot 0: ");
		printArray(pubkey, 64);
	} else {
		Serial.print("Genkey failed. Error code 0x");
		Serial.println(status, HEX);
	}

	delay(3000);
}

From my understanding, the code should be ok: no preparations in the TempKey slot are needed in order to generate a public key (but I could also be wrong on this). I also made sure that both chips are good, that slot 0 is storing a private key and is able to generate a public one, in fact I executed the GenKey command with a CryptoAuthentication kit connected via I2C, and everything's working fine.

Genkey

ECSign

From what I've read on the official Cryptoauthlib GitHub page, other people encountered this issue on RaspberryPi with I2C (the posts were dated something like 2019), and since other commands are working fine, I would exclude HAL problems and connection problems of any sort.
Yet, I have no idea why this is happening (I mean, that error code sounds definetly weird... Does the chip just wake?); I don't have access to an oscilloscope right now, but I've got no reason to doubt a bad package generation (all the codes and flags in the functions looked good to me) or errors during the transmission process.

Again, sorry if this post is huge, but I wanted to provide as much info as possible. Do you have any idea why this is happening?

Thank you in advance for your time and help.

Error 0xF0 with Arduino Uno

Hi, I would like to implement the ATECC608 in my security project with Arduino Uno, however, whenever I try to call an atcab function, it will always return error code F0 (Comm_Fail).
I've connected A4 and A5 pins to SDA and SCL pins of the device with a 4.7k pullup resistor.

Sorry if this is some kind of noob question, but I'm totally lost at this point (I've tried almost everything I could think of).
Thank you in advance for your help.

image
Serial output of AES example

Example for storing data

Hi @shinigami35 ..
Thanks for the amazing porting.
I am working with platformio and arduino framework too.
I would like to know if it possible with you modified lib saving data (certificates and keys for aws connection).

Thanks a lot for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.