2024-05-22 12:47 AM
Hi ST tesam,
When I use HAL_SMBUS_Master_Receive_IT( ) to receive data from device ,I can not got the information directly after the HAL_SMBUS_MasterRxCpltCallback( SMBUS_HandleTypeDef *hsmbus ) was complete.
(I had set a flag when HAL_SMBUS_MasterRxCpltCallback( SMBUS_HandleTypeDef *hsmbus ) done)
I had to wait for a while and then I can read data from register, but what can I do to know when the saving process was complete?
Regards,
LSN
Solved! Go to Solution.
2024-05-27 01:13 AM
Hello @LsnLeeJW
Could you please try to check the state in the SMBUS handle instead of checking bSMBusRxCpltFlag flag?
Please refer to the snippet code below to implement this solution:
HAL_SMBUS_Master_Receive_IT( &hsmbus1, BATTERY_ADD, &ucCalTemp[ 3 ], dataLength + 1 , SMBUS_LAST_FRAME_NO_PEC );
while (hsmbus1.State == HAL_SMBUS_STATE_MASTER_BUSY_RX);
2024-05-22 01:31 AM
Hello @LsnLeeJW and welcome to the community
Could you please provide the source code for this implementation?
2024-05-26 11:59 PM
2024-05-27 01:13 AM
Hello @LsnLeeJW
Could you please try to check the state in the SMBUS handle instead of checking bSMBusRxCpltFlag flag?
Please refer to the snippet code below to implement this solution:
HAL_SMBUS_Master_Receive_IT( &hsmbus1, BATTERY_ADD, &ucCalTemp[ 3 ], dataLength + 1 , SMBUS_LAST_FRAME_NO_PEC );
while (hsmbus1.State == HAL_SMBUS_STATE_MASTER_BUSY_RX);
2024-05-27 06:31 PM
It works , thanks for your help.