4.1 I/O Transactions
The ATECC608B-TNGTLS uses the I2C protocol to communicate with a host microcontroller. Security commands are sent to the device and responses are received from the device within a transaction that is constructed in the following way:
Byte | Name | Meaning |
---|---|---|
0 | Count | Number of bytes to be transferred to (or from) the device in the group, including the count byte, packet bytes and checksum bytes. Therefore, the count byte must always have a value of (N+1), where N is equal to the number of bytes in the packet plus the two checksum bytes. For a group with one count byte, 50 packet bytes and two checksum bytes, the count byte must be set to 53. The maximum size group (and value of count) is 155 bytes and the minimum size group is four bytes. Values outside this range will cause the device to return an I/O error. |
1 to (N-2) | Packet | Command, parameters and data or response. See 4.2 Command Packets for general command packet information or 5 Device Commands for specific parameters for each command. |
N-1, N | Checksum | CRC-16 verification of the count and packet bytes. The CRC polynomial is 0x8005. Prior to the start of the CRC calculation, the CRC register is initialized to zero. After the last bit of the count and packet is transmitted, the internal CRC register must have a value that matches the checksum bytes in the block. The first CRC byte transmitted (N-1) is the LSB of the CRC value, so the last byte of the group is the MSB of the CRC. |
The ATECC608B-TNGTLS is designed to have the count value in the input group consistent with the size requirements that are specified in the command parameters. If the count value is inconsistent with the command opcode and/or parameters within the packet, the ATECC608B-TNGTLS responds in different ways depending upon the specific command. The response may either include an error indication or some input bytes may be silently ignored.