Blog
Technology Sharing
Tower I3C Host Adapter Usage Example (8)hits:18


Easyi3C is a leading supplier of embedded system tools that simplify the development and debugging of various communication protocols. The company offers a range of products designed to help engineers and developers use I3C/I2C , USB and MIPI, JEDEC, MCTP and other protocols more efficiently.



Testing DDR5 SPD HUB IBI based on Tower I3C Host Adapter



1. SPD HUB IBI Background Introduction


The SPD5 Hub's IBI (Interrupt-Based Interface) is its core interrupt communication mechanism, used for real-time interaction between devices. The following are key features:

IBI Triggering Conditions

  • Error interrupt: When MR27 bit 1 is 1 and an error occurs in MR52[7:5,1:0], the SPD5 Hub will actively initiate an IBI interrupt. 

  • Temperature sensor interruption: If MR27[3:0] is 1 and MR51[3:0] is triggered, the SPD5 Hub will send an IBI.

IBI Transmission Process

  1)  Host response :

  • The host can ACK (accept) or NACK (reject) the IBI request.

  • If NACK is received, the SPD5 Hub retains the interruption flag and waits for the next request.

   2) Interruption of Arbitration :

  • When multiple devices conflict, the priority is determined by LID (Device ID) and HID (Identification Code).

  3) IBI payload content

  • It contains the values of MDB (Device Management Register) and MR51 and MR52.

Other precautions

  • PEC verification: If MR18 is enabled, the IBI payload must pass parity verification.

  • IBI Disabled: The IBI function can be turned off by using DEVCTRL CCC or MR18‎4=1.


2. Testing DDR5 SPD HUB IBI Based on Tower I3C Host Adapter


The IBI function is a new feature of I3C. It is not possible to test this function using only the existing I2C Host Adapter. In response to the new requirements of I3C, we have specially provided the following API for users to test and meet the testing needs of customers.

ibi.png


By combining this with our CCC command API, we can complete the IBI function of the DDR5 SPD HUB. For more detailed information, please visit Easyi3C  the official website to download and learn more for free.

The following test code can easily trigger IBI by inserting PEC error and Parity error. Detailed code is as follows:

# ==========================================================================
# --------------------------------------------------------------------------
# Copyright © 2025 by Easyi3C, Inc.
# All rights reserved.
# --------------------------------------------------------------------------
# ==========================================================================
import sys
from ezi3c.api import *
from ezi3c.utils import hex_string
from ezi3c import utils

from ddr5 import Spdhub


ez = ez_open()
if not ez:
    print("Cannot open Adapter")
    sys.exit(-1)
clk = ez_set_bus_clk_freq(ez,1000, 4000)
print("Cur Clk Freq: {}".format(clk))
ret = ez_set_io_voltage(ez, 1.0)
assert ret == 0, "Faield to set IO voltage"

spd = Spdhub(ez, hid=0x00)

try:
    ret = spd.ccc_rstdaa()
    assert ret == 0, "Failed to reset DAA: addr:{:02X}".format(spd.addr)

    ret, data = spd.i2c_read_reg(0, 2)
    assert ret == 0 and data == (0x51, 0x18), "Failed to read SPD data: addr:{:02X}".format(spd.addr)
    print("SPD Data: {}".format(hex_string(data)))

    spd.switch_to_i3c(send_ccc=True)
    ret, data = spd.i3c_read_reg(0, 2)
    assert ret == 0 and data == (0x51, 0x18), "Failed to read SPD data in I3C mode: addr:{:02X}".format(spd.addr)

    ret, data = spd.i3c_read_reg(0, 1)
    assert ret == 0 and data == 0x51, "Failed to read SPD data in I3C mode with PEC: addr:{:02X}".format(spd.addr)

    ret = spd.enable_pec(send_ccc=True)
    assert ret == 0

    ret = spd.i3c_write_reg(0, 0x00, inject_pec_err=True)
    ret, data = spd.i3c_read_reg(52)
    assert ret == 0 and data & 0x02 == 0x02

    ret = spd.i3c_write_reg(0, 0, inject_parity_err=True)
    ret, data = spd.i3c_read_reg(52)
    assert ret == 0 and data & 0x01 == 0x01

    spd.ibi_enable()
    spd.ccc_enec_broadcast(0X01)

    # while True:
    slave, data = spd.ibi_get(block=True)
    print("Received IBI: dev:{:02X}, payload:{}".format(slave, utils.hex_string(data)))


finally:
    spd.ccc_rstdaa()
    ez_close(ez)
    print("Adapter closed.")


3. conclusions


As described above, by utilizing the API provided by the Tower I3C Host Adapter, it is easy to insert different errors to trigger IBI and test the chip's IBI functionality.


Service Line:

Address:Silicon Valley
Email:support@easyi3c.com

Copyright © Easyi3C Co., LTD