Using the i2c_t3 library as suggested above. New code:
#include <i2c_t3.h>
void setup() {
// put your setup code here, to run once:
Wire.begin(I2C_SLAVE, 8, I2C_PINS_18_19, I2C_PULLUP_EXT, 400000);
}
void loop() {
// put your main code here, to run repeatedly:
}
Results in expected waveform. The Teensy is looking for an address of 8 but ignores (does not touch the I2C signals) the data from the STM32 because it's looking for a device at address 0x48. This is better than the original Wire library which modified the SCL line even when it did not match an address.
However, changing the 8 address to 0x48 results in the attached waveform. Some of the SCL pulses only rise to about 1v instead of being pulled all the way to GND or left alone to be pulled up by the resistor.
Also included is an annotated picture of the setup. In the picture everything is being powered by USB but I've also tried powering them with their own supplies and leaving the 5v link disconnected between them, as well as powering the Teensy's 5v supply from the Discovery which was being powered from a floating power supply channel.
I've also tried pulling up the resistors to the Teensy's 3.3v pin instead of the STM32's VDD at 3v but I get the same result either way.