Skip to main content
Visitor II
May 28, 2024
Question

Fighting SMBus on an STM32H5

  • May 28, 2024
  • 1 reply
  • 972 views

Hello people. I've been trying to get SMBus working on an STM32H5. I've see threads on here which use the SMBus HAL. For whatever reason, I wasn't able to get those to work, maybe because I'm not handling all the possible events appropriately.

What I was able to get working was using the X-CUBE-SMBUS package. It seems to add a lot of code, and to determine if a transaction is complete, I poll to see if the SMBus is ready, which I don't like, but at least I can read a register.

I haven't found any code examples for this package. The documentation (https://www.st.com/en/embedded-software/x-cube-smbus.html) is reasonably detailed with flow charts, but for some reason there aren't any code examples. Can anyone point me to a working SMBus implementation, either using just the SMBus HAL, or using that and the X-CUBE package?

    This topic has been closed for replies.

    1 reply

    Super User
    May 28, 2024
    BobWAuthor
    Visitor II
    May 28, 2024

    Thank you for replying, @AScha.3. The 1st link seems to be an example of reading an SMBus device using I2C, which can work to a point, but we want to support more of the SMBus protocol.

    The 2nd link is some of the code for using the X-cube-smbus package. I do have that code as a result of generating code using STM32CubeMx. SMBus is supported on the STM32H5.

    I'm hoping I can find a more complete example using the SMBus HAL or using the X-Cube-SMBus, where we have an example read and write to a chip or battery supporting SMBus.