2018-08-16 4:26 PM
Hi,
I am working on I2C read EEPROM. The HAL function failed due to the I2C_FLAG_BUSY is always SET.
Is there anything I am missing in init code?
Thx
if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK)
{
return HAL_TIMEOUT;
}
2018-08-17 4:42 PM
m_i2c->read_from_address(0b10100000, 0xFA, 1, in_data, in_len);
that's incorrect.
read is 0b10100001
2018-08-17 4:48 PM
You are right. I correct it OR to 0x01. Thx
2018-08-17 4:56 PM
works now ?
now we find the next issue :(
its a difficult struggle to bring up code on a new chip.
best not to use blocking code, otherwise you will continually have issues...
2018-08-20 8:53 AM
No, I corrected the READ command after you but still failing.
This is our existing driver for NXP MCP5777m. I just ported to STM32. Still seeing issue and it's on STM32 side for all of checking before sending I2C data out.
I am wondering if the init code not quite right. I am using MXCube code.
Thx
2019-01-16 5:40 PM
Hi,
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.
May you help me out, thanks.
2019-01-16 5:52 PM
Yes, that doesn't look like the usual I2C method, which is to have a WRITE with the Register Address, and then a READ which pulls the data.
Probably going to need to bit-bang the frame here.
2019-01-16 6:07 PM
thanks for your reply,
I have bit-bang and success, but I just want to know may stm32's i2c hsrdware generate the ware, by the way the chip is infineon's tle493d-A2B6.
have a nice day.
2023-06-06 4:08 PM
This is often because you don't have pull-ups on the SDA and/or SCL lines (4.7k-10k). You can also enable the internal pull-ups in the MCU itself.
2023-06-06 10:58 PM - edited 2023-11-20 9:40 AM
24AA02E48/25E48/24AA02E64/25E64 Data Sheet (microchip.com)
Notice the Restart bit in the middle? That is true I2C.
It does not match your reference shared document.
Same device, really?
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.