2009-01-26 13:20:09     i2c_smbus_write_block_data sends and extra byte

Document created by Aaronwu Employee on Aug 9, 2013
Version 1Show Document
  • View in full screen mode

2009-01-26 13:20:09     i2c_smbus_write_block_data sends and extra byte

ian davidson (UNITED KINGDOM)

Message: 68355   

 

I've installed an I2c driver, detected the client, checked its functionality, and attached the client, alll well and good.

 

In the "write" function of the driver I call i2c_smbus_write_block_data()

 

        client points to my client,

 

         command  = 0xFF;   // easy to see on a scope

 

         length = 1

 

         values points to a buffer that contains 0xAA; - again because it is easy to see on a scope

 

When I call this, what I want to see on the I2c Buss is  3 bytes, i2c address (3C), command (FF) and data (AA)

 

What I actually see on the I2C buss is 4 bytes;    3C FF 01 AA

 

For some reason, i2c_smbus_write_block_data() is inserting an extra byte (=01) after the first command byte.

 

If I increase the length of the data to send this is consistant, e.g

 

expecting :    3C FF AA AA AA

 

get                 3C FF 01 AA AA AA

 

client->flags is 0,    i.e. it does not have ten bit addressing set.

 

What have I not got configured correctly? and what do I need to do to fix it?, or where can I find this out?

 

Many thanks,

 

Ian davidson

 

 

QuoteReplyEditDelete

 

 

2009-01-27 10:42:43     Re: i2c_smbus_write_block_data sends and extra byte

ian davidson (UNITED KINGDOM)

Message: 68408   

 

Try using i2c_master_send instead of i2c_smbus_write_block

 

this works OK.

QuoteReplyEditDelete

 

 

2009-01-27 16:52:03     Re: i2c_smbus_write_block_data sends and extra byte

Mike Frysinger (UNITED STATES)

Message: 68440   

 

looks to me that it is behaving correctly according to the spec.  please see the i2c userspace documentation:

Documentation/i2c/dev-interface

Documentation/i2c/smbus-protocol

Attachments

    Outcomes