Skip to main content
abreiteneder9
Visitor II
November 15, 2016
Question

STM32F429 SMBus Implementation

  • November 15, 2016
  • 6 replies
  • 5782 views
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
This topic has been closed for replies.

6 replies

Technical Moderator
November 15, 2016
Posted on November 15, 2016 at 14:34

Dear User,

The SMBus stack is not supported by STM32F4 HAL drivers.

The request is already raised internally to our development team.

We apologize for any inconvenience this may have caused you and we appreciate your understanding.

Best Regards

STM32.forum

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
agnes
Associate II
February 21, 2017
Posted on February 21, 2017 at 16:37

hello,

I am interested in the same HAL driver. Do you have any update? Is it now available - even in beta?

warm regards,

Agnès CD

Technical Moderator
February 21, 2017
Posted on February 21, 2017 at 17:12

Hello

Cassin_Delaurier

‌,

Thanks for your interesting.

The SMBus for STM32F4 is not yet available. Your request is under investigation and

will be implemented in coming releases.

Best Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Igor Tabachnik
Associate
July 20, 2017
Posted on July 20, 2017 at 11:23

May be it is help us: 

https://github.com/Selat/stm32-smbus

 
matthewgkerr
Associate III
September 25, 2017
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.

Technical Moderator
September 26, 2017
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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
matthewgkerr
Associate III
September 26, 2017
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.

Technical Moderator
September 26, 2017
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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
kryczka
Associate
September 26, 2017
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
krutecki
Associate
October 3, 2017
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
kryczka
Associate
October 3, 2017
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
Leonid Kushnir
Visitor II
July 5, 2018
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