2020-01-13 01:12 AM
I use the HAL library function to transmit the wake up command to its I2C address.
#define I2C_ADDRESS 0xC0
HAL_I2C_Master_Transmit(&hi2c1, I2C_ADDRESS, 0x00, 4, 1000)
but my code always return HAL_ERROR and the chip never acknowledges. I'm fairly new to STM32 so Please correct me if I'm doing it wrong. Appreciate your answers!
2021-02-26 08:49 AM
Hi there!
Have you fixed this issue? I get the same situation and find that I2C_FLAG_AF is always set.
However, the chip actually works well, it can still receive 0x00 from stm32 and give 0x11 to stm32 if you don't use HAL_status to trigger HAL_I2C_Master_Receice command. I think it is related to the response time of ACK as ACK could sometimes be received under certain condition.
Cheers
Morris