cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_I2c_Mem_Read() failed

dbo
Associate II

0690X000006D8D0QAK.jpgHi,

I'm using HAL_I2c_Mem_Read(), too.

And may I ask if STM32's I2C can generate wave like the following picture. I have tryed Mem_read() and any other function in i2c.c , but the bit following device addres is "0",which means "write" in I2c.

eg.

I want to send bit.0110 1010->wait for ack, then send 0000 0011,

but fuction sends bit.01101011->wait for ack,then send 0000 0011.

I send bit 0110 1010 success,but can't send 0000 0011,

and fuction sends bit.0110 1011success, then fuction sends 0000 0011 success.

May I ask Stm32's I2c can send 0110 1010-ack-0000 0011 or not? Becease the LSB is "0" means write for I2C master, and LSB is"1" means read for I2C, so when LSB is "1" I2C can't write data to slave.

May you help me out, thanks.

2 REPLIES 2
dbo
Associate II

I have bit-bang and success, but I just want to know may stm32's i2c hardware can generate the ware, by the way the chip is infineon's tle493d-A2B6.

S.Ma
Principal

The 8 bit address bit 0 is the read (0) write (1) indicator

Here memory read may not work as it is a write (sub address) followed by a read, which typically is an EEPROM. You probably can't use the memory macro and need to reach lower level.