cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_I2C_MasterTxCpltCallback does not report transfer size/count

antonio.portaluri
Associate II

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

3 REPLIES 3
Takemasa
Associate III

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

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

None knows a solution?