I2C SPI USB CAN eSPI Cable Testing View All Quick Start Guides User Manuals Software Downloads Knowledge Base Videos Case Studies App Notes White Papers Sales Support How to Order
Products Blog Sales Support Contact Search

Understanding I2C Error Codes During Debugging

When debugging an I2C system, communication errors can be difficult to isolate without visibility into the bus. Issues like missing acknowledgements, unexpected start or stop conditions, bus contention, or timing violations can interrupt communication between devices and make it challenging to determine the root cause of a failure. Identifying and understanding these error conditions is an important part of validating and troubleshooting embedded systems.

The Beagle I2C/SPI Protocol Analyzer or the Promira Serial Platform configured with the I2C Analysis Application provide real-time visibility into the I2C bus, allowing users to capture, monitor, and debug I2C communication. Using Data Center Software, users can detect and troubleshoot a wide range of protocol-related issues directly within captured bus activity. 

This includes the Transaction Log, which displays captured bus activity in a human-readable format along with device addresses, detected errors, and protocol events. The I2C Timing Pane provides a detailed view of individual bytes, including associated start and stop conditions. 

Within the Transaction Log, the software flags detected protocol and transaction-related issues directly within the capture, helping users quickly identify abnormal bus behavior and communication failures. 

What are Common I2C Bus Issues?

Several common issues can interfere with proper I2C communication, including:

Bus Contention: Occurs when multiple devices attempt to communicate on the bus at the same time, causing data collisions and communication failures. This is most common in multi-master systems or improperly managed clock stretching scenarios.

Excessive Clock Stretching: Some I2C devices use clock stretching to hold the clock line low to delay communication. If the stretch duration exceeds the master’s timeout threshold, or if the master does not support clock stretching, synchronization issues or timeout errors can occur.

Incorrect Pull-up Resistor Values: I2C requires pull-up resistors on both the SDA (data) and SCL (clock) lines to maintain proper logic levels. Incorrect resistor values can result in slow signal transitions, unstable logic states, or unreliable bus operation. 

Device Address Conflicts: If multiple devices on the same bus share the same address, simultaneous responses may occur, resulting in corrupted data or failed transactions. This is especially common when using multiple devices of the same type without configurable addressing.

Incorrect Timing: I2C devices have setup and hold timing requirements for clock and data signals. Violating these can cause miscommunication or unexpected behavior.

No Slave Acknowledgment (NACK): A slave device may fail to send an acknowledgment (ACK) after receiving a data byte, resulting in failed communication. This may happen due to a malfunction or incorrect configuration of the device.

Bus Noise and Interference: External electromagnetic interference (EMI), poor PCB routing, long cable lengths, or inadequate signal integrity can introduce noise onto the bus, resulting in corrupted data, unexpected protocol behavior, or failed transactions.

Identifying Common I2C Bus Issues in Data Center Software 

When analyzing I2C traffic in Data Center Software, protocol and transaction-related issues are identified using error code indicators displayed directly within the capture window. These indicators help developers quickly identify communication problems such as missing acknowledgements, unexpected bus conditions, timing violations, and incomplete transactions. 

Common indicators include the “T” error, which flags transaction-level protocol violations, the “O” error, which identifies invalid or improperly detected stop conditions, and the “P” error, which indicates that the final byte captured in the buffer was incomplete. In these cases, the number displayed after the “P” error identifies how many bits were successfully received for the final byte. 

These errors are often associated with issues such as bus contention, excessive clock stretching, signal integrity problems, or improper device communication behavior. The following sections highlight several common I2C bus issues that can trigger these errors during debugging.

Example I2C Capture in Data Center Software

Bus Contention 

Transaction Log

  • Coinciding Read/Write Operations: Simultaneous read and write transactions on the same I2C address may indicate contention. 
  • Missing ACKs/NACKs: If the slave device fails to acknowledge a master's request (missing ACK or unexpected NACK), this could signal another master interfering on the bus.
  • Repeated Start Conditions in Place of a Stop Condition: Frequent repeated start conditions without proper stop conditions can be a sign of contention. The transaction log will indicate whether the start and stop conditions were observed for each record. S indicates the start condition; P indicates the stop condition. In the case of repeated start conditions occurring in contexts where a Stop condition is expected, only an S is displayed. Users may also see an O code, meaning a stop condition was required for the transaction but was not observed.

Timing Pane

  • Timing Issues: Irregularities in timing, such as inconsistent delays between clock edges or unexpected interruption, may indicate bus contention in the data flow.

Excessive Clock Stretching

Clock stretching is a standard feature of the I2C protocol that allows a slave device to temporarily hold the clock line (SCL) low while it completes internal processing before continuing communication. Clock stretching only becomes a concern when it is excessive or unexpected, specifically when the stretch duration exceeds the master’s configured timeout threshold, or when the master device does not support clock stretching and conflicts with a slave that uses it.

Transaction Log

  • Delayed Responses: In the Transaction Log, clock stretching can be indicated as delays in the master's operations, such as longer-than-expected gaps between data bytes or ACKs.
  • Prolonged Read/Write Times: If a transaction takes significantly longer than typical I2C timings, it could indicate clock stretching.

Timing Pane

  • Prolonged Low Periods on Clock Signal: In the Timing Pane, clock stretching may appear as the SCL line being held low for an extended period. This delay will occur between clock pulses or between a START condition and the next bit of data.

Incorrect Pull-up Resistor Values

Correct pull-up resistor values vary based on bus speed and capacitance, but typical values tend to fall within 1.5kΩ – 10kΩ. For specific calculation formulas, check out our blog, “What are I2C Pull-Up Resistors and How to Calculate their Values”.

Transaction Log

  • Frequent NACKs: Without adequate pull-up resistors, the SDA and SCL lines may fail to reach a valid logic-high state, causing devices to misinterpret signals and resulting in repeated "No ACK" events in the log.
  • Timeout Errors: The master might experience delays or timeout due to corrupted signals. Users may see a “T” error in this instance, which indicates a capture for transaction timed out while waiting for additional data.
  • Unexpected Start/Stop Conditions: Improper pull-up resistors can cause slow or noisy signal transitions, leading to misinterpretation of I2C protocol events. This may result in unexpected start/stop conditions or even the complete absence of stop conditions due to improper signal generation or recognition. In this case, users may receive an “O” error, indicating a stop condition was not observed during the capture.

Timing Pane

  • Slow Rise Times: If pull-up resistors are an incorrect value or absent, the transitions between bits (high to low or low to high) appear to take longer than expected. 

Device Address Conflicts

Addressing issues can occur when a master sends the wrong address due to misconfiguration or unintended address collision, or when multiple devices on the bus share the same address.

Data Center Software captures and displays the address byte, allowing users to check whether the correct slave device is being addressed and if the correct response is being received.

  • Address NACK: If the master sends a command to an invalid or non-existent address, no device on the bus will acknowledge the address byte, resulting in a "NACK" (Not Acknowledge). An asterisk (*) in the Address (Addr) column indicates that the address byte was not acknowledged.
  • Bus Collision: If multiple slave devices share the same address on the bus, it can lead to simultaneous communication attempts, causing data conflicts that result in unexpected behavior, corrupted messages, or even a complete bus failure.

Incorrect Timing

The I2C bus operates outside required timing specifications, leading to unreliable communication.

Transaction Log

  • Irregular Timestamps: The timestamps in the Transaction Log provide a record of when each event occurred. If the clock speed is incorrect, you might notice irregular intervals between data bytes or start or stop conditions.
  • Unintended Excessive Clock Stretching: In the Transaction Log, clock stretching can be indicated as delays in the master's operations, such as longer-than-expected gaps between data bytes or ACKs.

Timing Pane

  • Clock Held Low Extendedly: In the Timing Pane, clock stretching may appear as the SCL line being held low for an extended period. This delay will occur between clock pulses or between a START condition and the next bit of data.
  • Irregular Clock Periods: Instead of consistent clock pulses, you might see uneven spacing, indicating an issue with the clock generation.

No Acknowledgment (NACK)

The Data Center Software shows the absence of an acknowledgment bit (ACK) after the 8th data bit in a captured I2C transaction. You can observe when the NACK occurs in relation to the start condition, data bytes, and stop conditions in different ways.

Transaction Log

  • No ACK (NACK):  NACKed data bytes are marked with an asterisk (*) in the Transaction Log, helping identify communication issues such as unresponsive devices or failed data transfers.
  • Repeated Retries: If the master retries the operation after receiving a NACK, these repeated attempts will appear in the Transaction Log, showing the same address or command multiple times in sequence.
  • Unexpected Timeout: A transaction might terminate after receiving a NACK, signaling the master has abandoned the operation. Users may see a T error in this instance, which indicates a capture for transaction timed out while waiting for additional data.

Timing Pane

  • No ACK Signal on SDA: In the Timing Pane, 9 bits are displayed per line. The ninth bit is the ACK/NACK bit. The NACK is visualized as the SDA line remaining high during the ACK clock pulse (when it should go low if the slave acknowledges).
  • Interrupted Communication Flow: The Timing Pane graph may show gaps in communication if the master terminates operations due to a NACK. 

Bus Noise and Interference

Poor signal quality, often due to long cables, improper pull-up resistors, or noisy environments, can corrupt data on the bus. Total Phase protocol analyzers operate at the protocol level, and therefore, Data Center Software does not directly display analog signal integrity issues.

If the bus is not responding as expected and repeated protocol-level errors occur without an obvious software or configuration issue, it may indicate a lower-level signal integrity problem. Signs that may point to bus noise or interference include frequent NACKs, unexpected errors, corrupted data values, or transactions that do not behave as expected.

In these cases, using an oscilloscope can reveal the underlying electrical characteristics of the signals, such as noise, jitter, slow rise times, or signal degradation that would not be visible in a protocol capture.

General Protocol Error Codes in Data Center Software

Some general protocol error codes that indicate abnormal conditions that can be detected within the software include:

“U” Error – Unexpected 

A “U” Error indicates that a packet or event occurred outside of the expected context. This typically means that the analyzer detected bus activity at an unexpected point during the transaction process.

“T” Error – Time-Out 

A “T” error indicates that a capture for a transaction timed out while waiting for additional data. This can occur when the expected data or acknowledgment is not received within the expected time period due to issues such as unresponsive devices, clock stretching, or bus arbitration conflicts.

“M” Error – Middle of Packet

An “M” error indicates that data collection began in the middle of an active I2C transaction. Since the start condition and earlier portions of the packet were not captured, the software cannot fully interpret the transaction context.

“S” Error – Short Buffer

An “S” error indicates that a transaction exceeded the available capture buffer size. When this occurs, portions of the transaction may not be fully captured, resulting in incomplete data. 

“P” Error – Partial Last Byte

A “P” error indicates that the final byte in the capture buffer was incomplete. The number displayed after the error code identifies how many bits were successfully captured for the final byte. This can occur when a transaction ends unexpectedly or when the capture buffer is interrupted before the byte is fully received. 

I2C-Specific Error Codes in Data Center Software

In addition to general error codes, the Data Center Software can detect protocol-specific I2C, SMBus, and PMBus communication issues during analysis.

“O” Error – Stop is Required

An “O” error indicates that a required Stop condition was not detected during the transaction. Missing Stop conditions can leave the bus in an active or locked state, preventing other devices from communicating properly.

Common causes include excessive clock stretching, bus arbitration failures, hardware or signal integrity problems, slave devices holding the bus unexpectedly, timing violations, or firmware issues preventing the master device from generating the Stop condition.

“N” Error – No Protocol Match

An “N” error indicates that the captured transaction could not be matched to an expected protocol structure or decode format. While valid bus activity may still be present, the observed communication did not conform to the expected protocol behavior.

This error may occur due to protocol mismatches between devices, corrupted bus traffic caused by electrical noise, timing violations, malfunctioning slave devices, or software and firmware implementation issues.

“C” Error – PEC Problem

A “C” error indicates a transaction matched a protocol using Packet Error Checking (PEC), but the calculated PEC value did not match the received value. This suggests a potential data integrity issue during SMBus or PMBus communication.

Common causes include data corruption during transmission, electrical noise or interference, clock and timing violations, incorrect PEC implementation, device-specific protocol requirements, or firmware-related communication errors.

Note: The “C” error is only applicable when SMBus or PMBus decoding is enabled in Data Center Software. PEC settings can be configured through the I2C Bus Configuration Manager within the Transaction Window. For more information, check out our app note Monitoring and Emulating SMBus and PMBus Using Total Phase I2C Tools

“K” Error – Class Error

A “K” error indicates that the captured transaction structure did not match the protocol behavior expected for the detected SMBus or PMBus device class and command byte.

This error may occur when unsupported or incorrect command bytes are transmitted, when devices expect different command structures, when device classes are misidentified, or when communication is disrupted by timing issues, electrical interference, or firmware-related implementation errors.