cancel
Showing results for 
Search instead for 
Did you mean: 

Fighting SMBus on an STM32H5

BobW
Associate

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?

2 REPLIES 2
AScha.3
Chief

Hi,

maybe you look on git :

https://github.com/Coconutt69/stm32-ev3

https://github.com/leonf08/SMBUS_PMBUS-Stack-STM32F407

 

If you feel a post has answered your question, please click "Accept as Solution".

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.