Skip to main content
Visitor II
February 26, 2025
Question

STM32U545 I2C HAL weirdness

  • February 26, 2025
  • 1 reply
  • 480 views

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?

    This topic has been closed for replies.

    1 reply

    ST Employee
    March 6, 2025

    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