cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 SMBus Implementation

abreiteneder9
Associate
Posted on November 15, 2016 at 07:54

Dear all,

for a project I have to implement a SMBus communication with a battery. I already found the X-CUBE-SMBUS Software but it seems that it is only compatible with F0 and F3 Controllers. I also saw that these controllers include SMBus HAL drivers. My question is now if it is possible to port those libraries to the STM32F4 and which changes are necessry.

Greetings

#stm32f4 #smbus
19 REPLIES 19
Posted on September 15, 2017 at 20:54

>>which is quite a big pain.

You have to write several hundred lines of code and understand the hardware you are using, I'd be watching out for the robots....

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
matthewgkerr
Associate III
Posted on September 26, 2017 at 00:28

Dear ST,

Can you please provide an update on the progress of SMBus support in the F4 family?

I am using a 32F427 with HAL library version 1.16.0.

I urgently require SMBus functionality to talk to a Texas Instruments Battery Pack Manager (e.g. BQ40Z50). I also have an EEPROM on the same I2C bus, which I'm already talking to.

Any suggestions on how to proceed would be greatly appreciated. 

Regards,

Matt.

Imen.D
ST Employee
Posted on September 26, 2017 at 11:16

Hello,

You need the driver HAL SMBUS ? or you want the driver HAL SMBUS and the Firmware stack SMBUS ?

Could you please confirm if you need the SMBUS to do full feature of SMBUS or you can use Repeat feature on HAL I2C ?

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
kryczka
Associate II
Posted on September 26, 2017 at 11:58

Hi all,

In my case, it turned out that I don't need a full functionality of SMBUS and I2C was enough.

Separately from posting on the forum I sent a question to the technical support, here is part of the reply which might be interesting to all those who wait for the SMBUS support on any of the mentioned series:

'

The SMBUS support in the HAL library is not planned because of hardware limitations in the I2C cell.

This is true for the following STM32 series: STM32F1, STM32F2, STM32F4, STM32L1.

Full SMBUS support is not possible for those devices and this is the reason why smbus is not included in the HAL driver.'

 

 

Hardware which supports SMBUS is F3 and F7 series. Note however that in many cases you can use I2C just as well, so before switching the hardware make sure that you need all features of SMBUS.

Best regards,

 Przemek
Posted on September 26, 2017 at 12:11

Hi Imen,

I haven't done this before, so I'm not completely sure what SMBUS

drivers/firmware I might need.

What I need is to be able to read the current capacity of my Li-Ion

batteries. Today I started using the I2C mem read function (because I'm

using the same function to read an EEPROM device on the same bus) which

looks to be working. So I think I'm good.

I assumed because there is SMBUS HAL functions, that the I2C functions

wouldn't work.

Can you tell me more about this REPEAT function. How do I use it. And when

might I need it.

Regards,

Matt.

Posted on September 26, 2017 at 16:38

Hi,

By using the sequential feature on HAL I2C, you can manage common use case of SMBUS specification except :

  • Alert management

  • Timeout

  • Packet Error Check

Have a look to the these examples available on STM32Cube firmware package to perform I2C data buffer sequential transmission/reception between two boards using an interrupt :

  • I2C_TwoBoards_RestartAdvComIT

  • I2C_TwoBoards_RestartComIT

- STM32Cube_FW_F4_V1.16.0\Projects\STM32F429I-Discovery\Examples\I2C\I2C_TwoBoards_RestartAdvComIT

- STM32Cube_FW_F4_V1.16.0\Projects\STM32F429I-Discovery\Examples\I2C\I2C_TwoBoards_RestartComIT

Kind Regards,

Imen.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on October 03, 2017 at 22:38

Hi all & Przemek

I have the same issue - lack of SMBus support for L1 series in HAL. Which protocols have you implemented via I2c primitives? I need SMBus block read&write only.

Regards

KR
Posted on October 03, 2017 at 22:45

Hi KR,

In my case use of the bus is very simplistic. I only have a single memory cell access, so no block reading.

For your reference I am communicating with battery charger EB335.

I guess it won't help, but it clarifies what I do. I just had a quick look at the header file of the HAL i2c. There is a memory read option HAL_I2C_Mem_Read_DMA. Perhaps that's something to investigate. I have no idea how different is memory block reading between standard I2C and SMBus.

Best,

 Przemek
Posted on May 29, 2018 at 10:57

Is the SMBus HAL library now available?

Best regards

Leonid Kushnir
Associate
Posted on July 05, 2018 at 22:43

Hello everyone. Please try the code in following repository

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