So you're saying that middle waveform (with just the small spike) is the one from running the onInit code?
And you have hardware pullups on the I2C bus - if not that can be an issue since I don't think Espruino is able to use the internal pullup on STM32s, and software I2C can.
I can try checking with an I2C device on B6/B7 here and see if I can reproduce it. What happens if you do:
Just a note on hardware vs software I2C though - when using hardware, the software kicks off the I2C transmission, but then just busy-waits until it's finished - so you're not really saving many CPU cycles by going hardware vs software - it just means the waveform is a bit more regular (and it can be easier to hit 400kHz).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So you're saying that middle waveform (with just the small spike) is the one from running the onInit code?
And you have hardware pullups on the I2C bus - if not that can be an issue since I don't think Espruino is able to use the internal pullup on STM32s, and software I2C can.
I can try checking with an I2C device on B6/B7 here and see if I can reproduce it. What happens if you do:
Just a note on hardware vs software I2C though - when using hardware, the software kicks off the I2C transmission, but then just busy-waits until it's finished - so you're not really saving many CPU cycles by going hardware vs software - it just means the waveform is a bit more regular (and it can be easier to hit 400kHz).