2025-02-26 12:57 PM
Hi.
I'm working on a project using I2C on the U545, and I've noticed that all the HAL_I2C_Slave_* functions include the following:
/* Enable Address Acknowledge */
hi2c->Instance->CR2 &= ~I2C_CR2_NACK;
However, the STM32U5 Reference manual states that writing 0 to this bit has no effect.
Many of these functions also set this bit before exiting with the comment "Disable Address Acknowledge", however the RM also states that an Address match will cause the bit to be cleared by hardware.
What is going on?
2025-03-06 2:44 AM
Hello,
This line has been added to ensure the bit is at reset. Though, you're right, following the RM and in practice, it's not useful to keep it. The change has been taken into account for future development, but there's no intention to update the old ones.
BR,
Pauline