#[SOLVED] I2C: Device driver not found
1 messages ยท Page 1 of 1 (latest)
Did you enable any i2c nodes in the DTS?
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?
That's odd... That should be enough for it to show up. Maybe link to the build, or post the zephyr/.config
here's the config file
and the .dts from the build/zephyr folder in case that helps
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
Maybe the trackpad initialization failing is causing the issue.
Try disabling the trackpad, and seeing if the I2C shell works
just setting status = "disabled" is good?
Yup
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?
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
so I tried without the trackpad and I still get this "device driver not found"
@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;
}
Thank you! I'll try it