2019-05-01 05:17 AM
I2C2 is PB11,PB10 are connected to an AT24CM01 I2C eeprom. I get a few writes to the DR then the hal decided that the device is busy and all other calls fail because the device is busy. My writes and reads are trying to to do 240 bytes, not a very large packet. We are running the device slow, 8mhz crystal, 32 mhz internal bus to conserve power. I have verified that the hal sets up the pins to open drain alternate function i2c.
2019-05-02 05:49 AM
Since I was running the processor so slow, and the i2c packet was large, the routines were timing out. It is unclear in the manual if the timeout is per character or for the transfer. It is for the transfer. I set the timeouts to a much larger value and the I2C receive and Transmit routines now work. I also learned that if the hal driver has a problem it marks the device as busy, so it will never respond to another command unless you do a deint, then an init.