danielbuleandra opened a new pull request, #21854: URL: https://github.com/apache/nuttx/pull/21854
## Summary `NACKIE` is enabled for every transfer, but it is not in `I2C_CR1_ALLINTS`, so it stays enabled after the transfer ends. If a transfer times out while the peripheral is still busy, its NACK can arrive while the next transfer is being set up. The ISR then ends the new transfer and sets `priv->msgv` to `NULL` before `stm32_i2c_sendstart()` reads it. This adds `I2C_CR1_NACKIE` to `I2C_CR1_ALLINTS`, so the NACK interrupt is disabled with the other interrupts when a transfer ends. ## Impact Only the STM32H7 I2C driver. No impact on users, build, documentation, security or compatibility. ## Testing Tested on an STM32H743 board, Auterion FMU v6s, running PX4 with its NuttX 12.12.0 fork. Not tested at runtime on master. On master I built `stm32h745i-disco:touchtest` on Ubuntu with arm-none-eabi-gcc 14.2.1. The race is hard to hit, so I forced it with test code that is not part of this PR: one transfer returns right after START like a timeout, and the next one waits 300 us after setting `priv->msgv`, so the late NACK lands there. No test is added to nuttx-apps because this needs code inside the driver. ## PR verification Self-Check * [x] This PR introduces only one functional change. * [x] I have updated all required description fields above. * [x] My PR adheres to Contributing [Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md) and [Documentation](https://nuttx.apache.org/docs/latest/contributing/index.html) (git commit title and message, coding standard, etc). * [ ] My PR is still work in progress (not ready for review). * [x] My PR is ready for review and can be safely merged into a codebase. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
