Can't use I2C_4 on Seed

Has anyone else had any trouble with getting I2C_4 to work? I can’t get it to work for the life of me. I2C_1 works great, both in master and slave mode, on both sets of pins, DMA or polling…everything. I can’t get anything to work at all using I2CHandle::Config::Peripheral::I2C_4 . Init() returns okay, but it seems to be failing around here (i.e., it’s timing out). I’ve tried a variety of different timeout values as well.

Calling TransmitBlocking() works if I set periph to I2C_1 but not to I2C_4 . It just broadcasts into the void, but it’s sending the right init bytes (as verified with a logic analyzer). Here’s a GitHub Gist of my super-simple setup if anyone would like to try to recreate this:

Even just confirming that I2C_4 works on someone else’s board would be a big help. Any ideas?

1 Like

Happy new year! Anyone had a chance to take a look at this yet? Should I open an issue for it on GitHub?

Happy new year! I was actually planning on bringing this up to the team this afternoon :slight_smile:
Thank you for the wait!

1 Like

I mentioned it to @jgoney via DM, but I should share the info in case other folks are wondering about I2C_4.
I brought this up to the team, and it’s something that they have been meaning to have a closer look at whenever they have time.

I noticed that @jgoney recently opened a GitHub issue so that should be where you can see any update about it.

Thanks for the wait everyone!

Hi Guys,

Ok, I think I have fixed it.

line 634 of i2c.cpp in libDaisy should be:

GPIO_InitStruct.Alternate = GPIO_AF6_I2C4;


GPIO_InitStruct.Alternate = GPIO_AF4_I2C4;

Can some of you test this and see if it fixes your problem. Clean build libDaisy to make sure this is picked up.

p.s. It looks like getting DMA to work for I2C4 will take more work, not a simple fix. So if you need DMA don’t use I2C4.