#[SOLVED] I2C: Device driver not found

1 messages ยท Page 1 of 1 (latest)

honest umbra
#

I have a shell configured on ttyACM0, and enabled CONFIG_I2C and SHELL_I2C, but when I type i2c scan it tells me:

uart:~$ i2c scan
I2C: Device driver  not found.

Any suggestions on where to look for?

worldly pier
#

Did you enable any i2c nodes in the DTS?

honest umbra
#

here's what I have:

  • for the nice_nano:
&i2c0 {
    compatible = "nordic,nrf-twi";
    sda-pin = <17>;
    scl-pin = <20>;
};
  • in my shield overlay:
&i2c0 {
    status = "okay";

    trackpad@2a {
      label = "trackpad";
        compatible = "cirque,pinnacle";
        reg = <0x2a>;
    };
};

does that do it?

#

the code for the trackpad actually shows error logs, so that part is running. can it be that the trackpad code blocks the i2c shell from working?

worldly pier
#

That's odd... That should be enough for it to show up. Maybe link to the build, or post the zephyr/.config

honest umbra
#

in the shell I see:

uart:~$ device list
devices:
- CLOCK (READY)
- GPIO_1 (READY)
- GPIO_0 (READY)
- RNG (READY)
- CDC_ACM_0 (READY)
- HID_0 (READY)
- ADC_0 (READY)
- NRF_FLASH_DRV_NAME (READY)
- I2C_0 (READY)
- EXT_POWER (READY)
  requires: GPIO_0
- BATTERY (READY)
- trackpad (DISABLED)
  requires: I2C_0

I'm not sure why trackpad is disabled, maybe because it couldn't initialize. But still it says i2c_0 is ready

worldly pier
#

Maybe the trackpad initialization failing is causing the issue.

#

Try disabling the trackpad, and seeing if the I2C shell works

honest umbra
#

just setting status = "disabled" is good?

worldly pier
#

Yup

honest umbra
#

it says READY in the shell, and trackpad is not there anymore, but it still says device driver not found

#

DEVICE_DT_INST_DEFINE(n, pinnacle_init, NULL, &pinnacle_data_##n, &pinnacle_config_##n, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, &pinnacle_driver_api);
this is in the driver, should that call pinnacle_init automatically when the driver is set to "okay" or do I need to call it in some way explicitely?

honest umbra
#

the driver has DT_DRV_COMPAT=cirque_pinnacle and my i2c node has compatible="cirque,pinnacle" so from what I understand it should trigger the init in the driver? but it doesn't seem to do that

honest umbra
worldly pier
#

@honest umbra Oh! You're supposed to specify the bus to scan!

#

So i2c scan I2C_0

#
static int cmd_i2c_scan(const struct shell *shell_ctx,
            size_t argc, char **argv)
{
    const struct device *dev;
    uint8_t cnt = 0, first = 0x04, last = 0x77;

    dev = device_get_binding(argv[ARGV_DEV]);

    if (!dev) {
        shell_error(shell_ctx, "I2C: Device driver %s not found.",
                argv[ARGV_DEV]);
        return -ENODEV;
    }
honest umbra
#

Thank you! I'll try it

honest umbra
#

thank you, that's better, at least the i2c is trying to do something ๐Ÿ™‚

#

[SOLVED] I2C: Device driver not found