Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 I2Cv1 async write_read skips sending the last byte #3640

Open
sandermirme opened this issue Dec 11, 2024 · 0 comments
Open

STM32 I2Cv1 async write_read skips sending the last byte #3640

sandermirme opened this issue Dec 11, 2024 · 0 comments

Comments

@sandermirme
Copy link

The async I2C write_read command skips the last byte of the specified send buffer, unless the buffer contains only one byte.
Everything works correctly when the command is split into separate write and read.

MCU: STM32F407VGT which uses I2Cv1 implementation

Here are some commands and the resulting logic analyzer traces:

  1. Calling with two bytes actually sends one
i2c.write_read(0x28, &[0xe1, 0x02], &mut buf).await

Screenshot_20241211_090641

  1. Calling with three bytes actually sends two
i2c.write_read(0x28, &[0xe1, 0x02, 0x03], &mut buf).await

Screenshot_20241211_091454

  1. Calling with one bytes sends one
i2c.write_read(0x28, &[0xe1], &mut buf).await

Screenshot_20241211_090741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant