Using the Portenta H7 and the HAT Board, I need to use the I2C2 from the 40 pins HAT interface.:
Connection routes to the HDC connector J2 - are pin 45 and 47.
However checking the Schematics of the Portenta H7, this is marked as I2C4, and these pins are 'shared' wit the Camera interface data lines. DCMI_D2 and _D3 :
According the SMT32H745 Datasheet, I2C4 is on pin IO level PF14/PF15 and shared with the FMC_A8/_A9 (SDcard) :
Looks to me like a waste of resources - Why would the I2C2 from HAT (I2C4 from H7) be shared with the camera interface ? Looks to me like a bug / mistake ?
Questions : Is I2C4 connected to IO pins PF14/15 anyway?
If so, are there I2C drivers for H7-I2C4 ?
Cheers.
After digging into the STM32H745 datasheets, I came aware of the following regarding I2C4 :
It seems the I2C4 peripheral is sharable on multiple IO-pins, including the DCMI pins D2/D3 - so layout looks to be correct.
Checking the IO pins PH11 and PH12 in the H7 Arduino library, these are used for I2C pins : SDA2 and SCL2 :
This means the pre-defined Wire2 should be working : (Wire-Library Wire.cpp)
#if WIRE_HOWMANY > 0
arduino::MbedI2C Wire(I2C_SDA, I2C_SCL);
#endif
#if WIRE_HOWMANY > 1
arduino::MbedI2C Wire1(I2C_SDA1, I2C_SCL1);
#endif
#if WIRE_HOWMANY > 2
arduino::MbedI2C Wire2(I2C_SDA2, I2C_SCL2);
#endif
The fact is unfortunately : its not working.
Tested on a Portenta C33 board with HAT : works fine. (also Wire2)
Testing on a H7 board with HAT: doesn't find the I2C peripheral.
Any suggestions ?