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

STM32F4 I2C Driver must have an elevated interrupt priority #37

Open
tyler-gilbert opened this issue Dec 10, 2018 · 1 comment
Open

Comments

@tyler-gilbert
Copy link
Member

When using HAL_I2C_Mem_Read_IT(), there is a race condition that happens if the interrupt priority of the I2C is not elevated.

The interrupt gets stuck in a loop handling I2C_MasterTransmit_BTF() because the state is set to RX so I2C_MasterReceive_BTF should be called rather than I2C_MasterTransmit_BTF().

@tyler-gilbert
Copy link
Member Author

Use HAL_I2C_Master_Sequential_Transmit_IT() and HAL_I2C_Master_Sequential_Receive_IT() instead of HAL_I2C_Mem_Read_IT() to fix this.

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