Skip to main content
one V
Associate III
February 15, 2019
Question

Is this a bug in the HAL library about smbus?

  • February 15, 2019
  • 13 replies
  • 3364 views

0690X000006DcShQAK.png

0690X000006DcV7QAK.png

0690X000006DcYfQAK.png

0690X000006DcYkQAK.png

This topic has been closed for replies.

13 replies

ST Technical Moderator
February 15, 2019

Hello,

Which CubeMx and Cube package versions used ?

I cannot reproduce this issue. Can you please share your ioc file for check.

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
one V
one VAuthor
Associate III
February 15, 2019

0690X000006DclyQAC.png

0690X000006Dcm3QAC.png

ST Technical Moderator
February 15, 2019

Hi,

After more check, I confirm that the problem exists for hdmarx and hdmatx with I2C4.

I transfer this issue to developer team for fix.

Thanks for your contribution.

Thanks,

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
one V
one VAuthor
Associate III
February 15, 2019

By the way, i2c4 can read external device data, but the i2c+BMDA method does not work. How to solve it?

Nesrine.JLASSI
Visitor II
February 15, 2019

Hi @one V​ 

Thanks for the feedback.

It will be corrected in the next STM32CubeMX version .

Regards,

Nesrine

one V
one VAuthor
Associate III
February 16, 2019

So, the code generated by STM32CUBEMX(5.0.1) in I2C4+BDMA mode is not working now?

Nesrine.JLASSI
Visitor II
February 18, 2019

​Hi @one V​ 

DMA requests should not be used when I2C mode is set to one of the SMBUS modes.

That will be corrected in the next STM32CubeMX version.

Regards,

Nesrine

one V
one VAuthor
Associate III
February 18, 2019

Thank you for your reply.

However, I2C mode does not seem to work, can you test it?

0690X000006DfSzQAK.png

0690X000006DfT4QAK.png

Nesrine.JLASSI
Visitor II
February 18, 2019

Hi @one V​ 

In STM32Cube_FW_H7_V1.3.2\Drivers\STM32H7xx_HAL_Driver\Inc path.

In the typedef struct __I2C_HandleTypeDef of stm32h7xx_hal_i2c.h file, you will find :

DMA_HandleTypeDef      *hdmatx;    

DMA_HandleTypeDef      *hdmarx;     

but it isn't available in stm32h7xx_hal_smbus.h

So, when I2C mode is set to one of the SMBUS modes as shown in this figure:

0690X000006Dg9UQAS.png

The DMA Tab must be removed when I2C is set to SMBUS mode .

==> This problem only exists for I2C4.

This bug will be fixed in the next STM32CubeMX version ( STM32CubeMX 5.1: That will be available Week 9 ).

Regards,

Nesrine.

one V
one VAuthor
Associate III
February 19, 2019

No, no. I already know what you said, and this is why I reported the bug to you. I want to ask is the I2C(i2c+BDMA) mode working properly?

0690X000006DgbOQAS.png0690X000006DgbTQAS.png

Nesrine.JLASSI
Visitor II
February 19, 2019

​Hi @one V​ 

No problem when using the I2C (I2C + BDMA) mode as long as there is the definition of hdmatx and hdmarx in the stm32h7xx_hal_i2c.h file.

0690X000006DguzQAC.png

0690X000006Dgv4QAC.png

0690X000006DgvTQAS.png

Regards,

Nesrine.

one V
one VAuthor
Associate III
February 19, 2019

Yes, the generated code will not report an error, which I also know. But what I mean is, have you actually measured it available?

Thank you again for your answer.