user45743: Did someone ever used the Infineon Optiga Trust X module with Arduino using any I2C library ?
Here is the technical documentation of the Trust X module.
I'm trying to get the I2C_STATE register data but I don't receive anything after the Wire.requestFrom().
I also tried with the DSS Circuits I2C Master Library, same results.
Thanks
Full code :
#include <Wire.h>
#define PIN_RST 8
#define PIN_VDD 9

void setup() {
  pinMode(PIN_RST, OUTPUT);
  pinMode(PIN_VDD, OUTPUT);
  digitalWrite(PIN_RST,LOW);
  digitalWrite(PIN_VDD,LOW);

  Serial.begin(115200);
  delay(2000);
  Wire.begin(); // join i2c bus (address optional for master)

  digitalWrite(PIN_VDD,HIGH);  // sartup the Trust X module
  digitalWrite(PIN_RST,HIGH);

  delay(15);  // startup min delay
}

long val = 9999;

void loop() {
  Wire.beginTransmission(48); // transmit to device #48 (0x30)
  Wire.write(byte(0x82));            // sends instruction byte
  Wire.endTransmission();     // stop transmitting

  Wire.requestFrom(48, 4);
  while(Wire.available()==0){}

  val = Wire.read(); // Reads the data from the register
  Serial.print("val = ");
  Serial.println(val);

  delay(5000);

}


user45743: So I finally succeeded to read a register value. I don't really know where was the problem. Here is the code if it can help someone (the scanner still does not work btw) :
#include <Wire.h>

#define DEVICE_ADDRESS 0x30

#define PIN_RST 8
#define PIN_VDD 9

void printOutput(byte *out, int out_len){
   int y=0;
  Serial.print("out = ");
  for(;y<out_len;y++){
    Serial.print(out[y],HEX);
  }
  Serial.println("");
}

void coldReset(){
  pinMode(PIN_RST, OUTPUT);
  pinMode(PIN_VDD, OUTPUT);
  digitalWrite(PIN_VDD,LOW);
  digitalWrite(PIN_RST,LOW);
  delayMicroseconds(2000);
  digitalWrite(PIN_VDD,HIGH);  // sartup the Trust X module
  digitalWrite(PIN_RST,HIGH);
}

int I2C_get(byte reg, byte *out, int out_len){
  int i=0, nbSend=0, nbAvailable=0, ret=0;
  Wire.beginTransmission(DEVICE_ADDRESS); // transmit to device #48 (0x30)
  nbSend=Wire.write(reg);            // sends instruction byte
  Wire.endTransmission();     // stop transmitting
//  Serial.print("nb send = ");
//  Serial.println(nbSend);

  delayMicroseconds(50);
  Wire.requestFrom(DEVICE_ADDRESS, out_len);

//  nbAvailable=Wire.available();
//  Serial.print("nb available = ");
//  Serial.println(nbAvailable);

  if(Wire.available()==out_len){
    for(;i<out_len;i++){
      out[i]=Wire.read();
    }
  }
  else ret=-1;

  return ret;
}

void setup() {

  Serial.begin(115200);
//  Wire.begin(); // join i2c bus (address optional for master)
//  coldReset();
//  delayMicroseconds(15000); // Startup time
}


void loop() {
  int y=0, out_len, ret;
  byte res1[]={0x00,0x00,0x00,0x00};

  Wire.begin(); // join i2c bus (address optional for master)
  Wire.setClock(400000);
  coldReset();
  delayMicroseconds(15000); // Startup time

  out_len=4;
  ret=I2C_get(byte(0x84),res1,out_len);
  if(ret!=-1){
    printOutput(res1,out_len);
  }
  else{
    Serial.println("Error I2C_get");
  }

  Wire.end();
  Serial.println("");
  delay(5000);
}


user71420: It looks like the answer is a bit delayed, but if somebody else sees this issue once again.
It might not be directly visible in the documentation (Datasheet or Solution Reference Manual), but here what you can find in the Trust M Datasheet Annex B (Section 11):
"The OPTIGA™ Trust M will not acknowledge the slave address sent by a host if it is either busy or in idle state. Hence the host must retry or repeat the transaction until it is successful or timed out for 100 milliseconds (extreme case).
The specified guard time must be applied between each attempt of write / read operation by the Host I2C driver."
The chip always goes into an idle or sleep state if no command is issued in a defined time period, unless a Sleep Activation Delay isn't changed.

45743: <p>Did someone ever used the Infineon Optiga Trust X module with Arduino using any I2C library ?</p>

<p>Here is the <a href="https://www.infineon.com/dgdl/Infineon-OPTIGA%20TRUST%20X%20SLS%2032AIA-DS-v12_17-EN.pdf?fileId=5546d462602a9dc801606f1c2ebb7fe9" rel="nofollow noreferrer">technical documentation</a> of the Trust X module.</p>

<p>I'm trying to get the I2C_STATE register data but I don't receive anything after the Wire.requestFrom().</p>

<p>I also tried with the <a href="http://dsscircuits.com/articles/arduino-i2c-master-library" rel="nofollow noreferrer">DSS Circuits I2C Master Library</a>, same results.</p>

<p>Thanks</p>

<p>Full code :</p>

<pre><code>#include &lt;Wire.h&gt;
#define PIN_RST 8
#define PIN_VDD 9

void setup() {
  pinMode(PIN_RST, OUTPUT);
  pinMode(PIN_VDD, OUTPUT);
  digitalWrite(PIN_RST,LOW);
  digitalWrite(PIN_VDD,LOW);

  Serial.begin(115200);
  delay(2000);
  Wire.begin(); // join i2c bus (address optional for master)

  digitalWrite(PIN_VDD,HIGH);  // sartup the Trust X module
  digitalWrite(PIN_RST,HIGH);

  delay(15);  // startup min delay
}

long val = 9999;

void loop() {
  Wire.beginTransmission(48); // transmit to device #48 (0x30)
  Wire.write(byte(0x82));            // sends instruction byte
  Wire.endTransmission();     // stop transmitting

  Wire.requestFrom(48, 4);
  while(Wire.available()==0){}

  val = Wire.read(); // Reads the data from the register
  Serial.print("val = ");
  Serial.println(val);

  delay(5000);

}
</code></pre>
 45743: <p>So I finally succeeded to read a register value. I don't really know where was the problem. Here is the code if it can help someone (the scanner still does not work btw) :</p>

<pre><code>#include &lt;Wire.h&gt;

#define DEVICE_ADDRESS 0x30

#define PIN_RST 8
#define PIN_VDD 9

void printOutput(byte *out, int out_len){
   int y=0;
  Serial.print("out = ");
  for(;y&lt;out_len;y++){
    Serial.print(out[y],HEX);
  }
  Serial.println("");
}

void coldReset(){
  pinMode(PIN_RST, OUTPUT);
  pinMode(PIN_VDD, OUTPUT);
  digitalWrite(PIN_VDD,LOW);
  digitalWrite(PIN_RST,LOW);
  delayMicroseconds(2000);
  digitalWrite(PIN_VDD,HIGH);  // sartup the Trust X module
  digitalWrite(PIN_RST,HIGH);
}

int I2C_get(byte reg, byte *out, int out_len){
  int i=0, nbSend=0, nbAvailable=0, ret=0;
  Wire.beginTransmission(DEVICE_ADDRESS); // transmit to device #48 (0x30)
  nbSend=Wire.write(reg);            // sends instruction byte
  Wire.endTransmission();     // stop transmitting
//  Serial.print("nb send = ");
//  Serial.println(nbSend);

  delayMicroseconds(50);
  Wire.requestFrom(DEVICE_ADDRESS, out_len);

//  nbAvailable=Wire.available();
//  Serial.print("nb available = ");
//  Serial.println(nbAvailable);

  if(Wire.available()==out_len){
    for(;i&lt;out_len;i++){
      out[i]=Wire.read();
    }
  }
  else ret=-1;

  return ret;
}

void setup() {

  Serial.begin(115200);
//  Wire.begin(); // join i2c bus (address optional for master)
//  coldReset();
//  delayMicroseconds(15000); // Startup time
}


void loop() {
  int y=0, out_len, ret;
  byte res1[]={0x00,0x00,0x00,0x00};

  Wire.begin(); // join i2c bus (address optional for master)
  Wire.setClock(400000);
  coldReset();
  delayMicroseconds(15000); // Startup time

  out_len=4;
  ret=I2C_get(byte(0x84),res1,out_len);
  if(ret!=-1){
    printOutput(res1,out_len);
  }
  else{
    Serial.println("Error I2C_get");
  }

  Wire.end();
  Serial.println("");
  delay(5000);
}
</code></pre>
 71420: <p>It looks like the answer is a bit delayed, but if somebody else sees this issue once again.</p>
<p>It might not be directly visible in the <a href="https://github.com/Infineon/optiga-trust-m/tree/trust_m1_m3/documents" rel="nofollow noreferrer">documentation</a> (Datasheet or Solution Reference Manual), but here what you can find in the Trust M Datasheet Annex B (Section 11):
&quot;The OPTIGA™ Trust M will not acknowledge the slave address sent by a host if it is either busy or in idle state. Hence the host must retry or repeat the transaction until it is successful or timed out for 100 milliseconds (extreme case).
The specified guard time must be applied between each attempt of write / read operation by the Host I2C driver.&quot;</p>
<p>The chip always goes into an idle or sleep state if no command is issued in a defined time period, unless a Sleep Activation Delay isn't changed.</p>
