TWIM (I2C) on NCS is not working properly.

First of all, the fast mode should be 400kHz, but it seems to be only 200kHz according to the waveform. Also, the duty cycle seems to be wrong.

Secondly, It seems that CONFIG_I2C_CALLBACK is not working at all. I have written the callback function as follows, but it is not called.

/* Callback */
K_SEM_DEFINE(k_sem, 0, 1);
static void twim_callback(const struct device *dev, int result, void *data)
{
    printk("Callback\n");
    k_sem_give(&k_sem);
}
That is obvious since there is no log display and no semaphore to go through.
I am working on a project using TWIM and I hope these bugs will be fixed soon.
Parents Reply Children
  • Hmm, I had a device connected for testing purposes, that's the biggest difference.

    I will check it with the device disconnected and see if there are any big differences.

    I am also pretty sure that I have used the nRF5340 DK I2C without issues.

    Could you send me the compiled zephyr.hex of my project? Just so that I can check the exact same binary that you have used.

    Best regards,

    Michal

Related