Was someone able to read and write data to the Kasli's EEPROM? I added:

device_db["eeprom"] = {
    "type": "local",
    "module": "artiq.coredevice.kasli_i2c",
    "class": "KasliEEPROM",
    "arguments": {"port": "LOC0"}
}

to the device_db and tried to run it with the following experiment

from artiq.experiment import *

class Example(EnvExperiment):
    def build(self):
        self.setattr_device("core")
        self.setattr_device("eeprom")

    @kernel
    def run(self):
        self.core.reset()

        print(eeprom.read_i32(0))

but I always receive artiq.coredevice.exceptions.I2CError: failed to ack bus address when running the experiment.

fsagbuya Yes, changing the address to 0xae as you suggested did the trick! Is that a bug in KasliEEPROM?

    Hi, I would like to ask a further question. I am wondering is it possible to send/receive signal through SFP ports using the similar method since I see SFP ports are inside the port_mapping in kasli_i2c.py as well. Thank you!

    5 days later

    Yes that should work, did you try it?

    Hi, thank you so much for your reply.

    I have tried to run the following code with the latest artiq-8. I use artiq_run command in nix shell. But it seems to be not working.

    device_db["SFP1"] = {
        "type": "local",
        "module": "artiq.coredevice.kasli_i2c",
        "class": "KasliEEPROM",
        "arguments": {"port": "SFP1", "address":0xae}
    }
    
    from artiq.experiment import *
    class Example(EnvExperiment):
        def build(self):
            self.setattr_device("core")
            self.setattr_device("SFP1")
    
        @kernel
        def run(self):
            self.core.reset()
            print(self.SFP1.read_i32(0))

    And I got the following error:

    Traceback (most recent call first):
      File "<artiq>/coredevice/i2c.py", line 133, column 13, in artiq.coredevice.i2c.i2c_read_many(..., ...)
        raise I2CError("failed to ack bus address")
        ^
      File "test.py", line 13, in artiq_run_test.Example.run(..., ...) (RA=+0x1d4)
        print(self.SFP1.read_i32(0))
      File "<artiq>/coredevice/kasli_i2c.py", line 70, in ... artiq.coredevice.kasli_i2c.KasliEEPROM.read_i32<artiq.coredevice.kasli_i2c.KasliEEPROM>(...) (RA=+0x34c)
        i2c_read_many(self.busno, self.address, addr, data)
      File "<artiq>/coredevice/i2c.py", line 133, in ?? (RA=+0x55c)
        raise I2CError("failed to ack bus address")
    artiq.coredevice.exceptions.I2CError(3): failed to ack bus address

    I am wondering if it's possible to send/receive signal from SFP1 in a real time fashion, which is super helpful since we have time sensitive experiments going on in the lab.

    I really appreciate any suggestions and help!

    10 days later

    Well do you have something on that SFP I2C bus that responds to that address? Check the signals with an oscilloscope or logic analyzer.