cancel
Showing results for 
Search instead for 
Did you mean: 

I2C HAL_I2C_ERROR_AF is set and the 2nd byte is not transmitted.

T J
Lead
Posted on February 05, 2017 at 08:44

using CubeMX V4.18.0. and uV5,  stole parts from the '091 examples

I can see the ACK from the slave device, on the Oscilloscope

but

trying to send 0x68, 0x0E,0x00,0x00 as a packet

it sends 1 byte the 0x68 and stops.

while(HAL_I2C_Master_Transmit(&hiic2_Rtc, (uint16_t)I2C_ADDRESS, (uint8_t*)data, TXBUFFERSIZE, 10) != HAL_OK)

exits with HAL_I2C_ERROR_AF  ,  after just one byte

I am probably doing something wrong.

mbed works properly on the port.

what s the best advice for running the IIC port on a STM32F091 ?

1 ACCEPTED SOLUTION

Accepted Solutions
T J
Lead
Posted on February 07, 2017 at 06:34

I found the problem, and the fix

    int     I2C_ADDRESS = DS3231_I2C_ADRS <<1;

  after I corrected the address shift, it all worked.

View solution in original post

2 REPLIES 2
T J
Lead
Posted on February 07, 2017 at 06:34

I found the problem, and the fix

    int     I2C_ADDRESS = DS3231_I2C_ADRS <<1;

  after I corrected the address shift, it all worked.

Posted on June 10, 2017 at 21:33

Thank you!

Didn't undertand my IO expander didn't start to work.