-
Describe the bug When trying to read a single register via sam0 i2c bus, an extra address byte is sent on the wire. I2C devices support reading a single byte by first writing the address with the RW bit set high, followed by writing a second byte which sets up an internal pointer register, followed by a subsequent read for clocking in the data from the remote device. The i2c_sam0 driver does not support this feature. the implementation of i2c_transfer intentionally sends the address byte with the start of every As partial workaround, I am able to use the driver to read the entire chip in one shot in order to target the register I want. However, not being able to select a specific register with a control byte write means I cannot use this driver to manage interrupts in a practical way (which are Clear on Read). To Reproduce Build any board that uses the i2c_sam0.c driver and enable the I2C_SHELL. Then try to read a single byte on the bus with the shell command i2c read_byte sercom@xxxxxxxxx ADDR REG and observe that 2 address bytes are sent on the wire. Other notes I think this should be a bug, however, the zephyr docs explicitly say that (paraphrasing) "some drivers don't work". So - i think a discussion might help me understand zephyr's i2c driver expectations, and how to read a single byte on a i2c device connected to an atmel i2c same0 peripheral. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I can confirm, as this bit me today :) And I think this should be tracked as a bug, would you mind opening one please? Thanks! |
Beta Was this translation helpful? Give feedback.
-
For anyone looking before it's merged, there's a fix in #55385 (cc: @kartben) |
Beta Was this translation helpful? Give feedback.
I can confirm, as this bit me today :) And I think this should be tracked as a bug, would you mind opening one please? Thanks!