This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

i2c: NACK detected

Other Parts Discussed in Thread: TVP5146

I have a mt9t001 cmos sensor connected to the 355evm,and I have set the right environment:

bootdelay=3
baudrate=115200
ethaddr=02:00:00:00:00:00
filesize=1e0d08
fileaddr=80700000
ipaddr=192.168.1.3
nfshost=192.168.1.5
rootpath=/home/brdsp/workdir/filesys
serverip=192.168.1.5
bootfile=uImage-dm355
bootcmd=tftp;bootm
bootargs=console=ttyS0,115200n8 noinitrd rw ip=192.168.1.3:192.168.1.1:192.168.1.1:255.255.255.0 root=/dev/nfs nfsroot=192.168.1.5:/home/brdsp/workdir/filesys,nolock mem=116M v4l2_video_capture=device:MT9T001

when I boot ,the following error displayed:

RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected..................

So I decided to look out what wrong, and I checked my cmos sensor board,didn't found anything wrong .Then,I traced into the driver mt9t001.c,and I found that in function i2c_write_reg(),at the following codes:

  }else if (configdev == MT9T001_I2C_CONFIG) {
   msg->addr = client->addr;
   msg->flags = 0;
   msg->len = I2C_THREE_BYTE_TRANSFER;
   msg->buf = data;
   data[0] = reg;
   data[1] = (val & I2C_TXRX_DATA_MASK_UPPER) >>I2C_TXRX_DATA_SHIFT;
   data[2] = (val & I2C_TXRX_DATA_MASK);
   err = i2c_transfer(client->adapter, msg, 1);

the code:msg->addr=client->addr,I am a little confused:client is a parameter of i2c_write_reg,and in fact it's i2c_write_reg(&mt9t001_i2c_client, MT9T001_ROW_START, MT9T001_ROW_START_DEFAULT, MT9T001_I2C_CONFIG);

And mt9t001_i2c_client is :static struct i2c_client mt9t001_i2c_client;

I have serach the whole linux kernel ,didn't found anywhere that gived value to mt9t001_i2c_client.addr.

So my question is ,since i2c_write_reg() is writing value to mt9t001,why there's no address?

  • Sorry, I have just found it here:

    static int _i2c_attach_client(struct i2c_client *client,
             struct i2c_driver *driver,
             struct i2c_adapter *adap, int addr)
    {
     int err = 0;
    #ifdef MT9T001_I2C_ENABLE
     if (client->adapter) {
      err = -EBUSY; /* our client is already attached */
     } else {
      client->addr = addr;
      client->flags = I2C_CLIENT_ALLOW_USE;
      client->driver = driver;
      client->adapter = adap;

      err = i2c_attach_client(client);
      if (err) {
       client->adapter = NULL;
      }
     }
    #endif
     return err;
    }
    but I still don't know what's wrong with my board?Can somebody help me?

  • after reviewing the PSP docs, I discovered a few things worth considerin

    1) Do you have the proper options enabled in the kernel and are you building MT9T001 driver as a module to be loaded dynamically or as part of kernel itself? (see SPRUFG0 included in DVSDK, a.k.a LSP 1.20 installation user guide for more details)

    2) One document suggests that "davinci_capture.device_type=0" be included as part of bootargs(CCD driver User Guide, spruep7) while another suggests "v4l2_video_capture=device:MT9T001", although it looks like the latter is working for you, it would not hurt to include both.

    3) Finally, the LSP 1.20 data manual, sprs496.pdf (included in DVSDK) list some constraints that may explain the I2C errors you are seeing.

  • Hi,

    I have a DM355 EVM and when I load the drivers as:

    insmod tvp5146.ko

    insmod mt9t001.ko

    insmod davinci_capture.ko device_type=0

     

    I get the error as:

    DaVinci I2C WARNING: i2c: NACK detected

    DaVinci I2C WARNING: i2c: NACK detected

    DaVinci I2C WARNING: i2c: NACK detected

    .

    .

    .

    Since the problem seems same as mentioned above I want to learn whether you have solved the problem or not? 

    As a second question I always try changing below files to change the given driver (mt9t001.c) and built my kernel again making this driver as a module.

    -lsp/ti-davinci/drivers/media/video/davinci/mt9t001.c

    -lsp/ti-davinci/include/media/davinci/mt9t001.h

    Am I supposed to change some other upper level driver source files to use this mt9t001.c ?

    Note: I have to change mt9t001.c to use with my ST 6724 cmos camera module.

    Waiting your soonest replies.

    Ferhat