Skip to main content
antonio.portaluri
Associate II
December 19, 2018
Question

HAL_I2C_MasterTxCpltCallback does not report transfer size/count

  • December 19, 2018
  • 3 replies
  • 783 views

Hello,

I'm new to the forum.

I have a Nucleo-L476RG board and I use Keil with Keil::STM32L4xx_DFP 2.1.0 to program it.

During the debug I notice that after the HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, ...) function call the hi2c->XferSize and hi2c->XferCount are correctly set.

But in the HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c) callback, if I try to access to hi2c->XferSize and hi2c->XferCount are both 0x0000. So I can't retrieve the real bytes sent?

If I do the same work with the UART dirver all is ok. Why this different behavior?

Thanks in advance,

Antonio

This topic has been closed for replies.

3 replies

Takemasa
Associate III
December 24, 2018

I have similar problem. In the STM32HAL, getting the transferred count is not documented. So, I am spending time to sniffing source code, but the behavior is so confused.

Please tell me the "right way".

antonio.portaluri
Associate II
January 3, 2019

Hi,

I didn't find a solution up to now. I think this is a bug, but I'm new to the STM family, so I don't know how to report it.

If you find some solution, please, report it here.

Thank you,

Antonio

antonio.portaluri
Associate II
January 29, 2019

None knows a solution?