I2C2 on STM32F

Hi,

I just uploaded the MPU6050 library to communicate with my STM32F103.
Example program is MPU6050DMP6.

All works fine when I use I2C1 (default I2C bus).

But I want to use the I2C2 bus (controller has 2).

On this forum I found information stating:

#include "Wire.h"
extern TwoWire Wire1;

And in my setup part use:
Wire.begin();
Wire1.begin(); /Wire1 should use second port...

For the rest there are no more Wire instructions in the MPU6050_DMP6 program.

I can compile it, but when downloading, it just crashes....

Any idea's what goes wrong or where I can find more data?

Thank you

For the rest there are no more Wire instructions in the MPU6050_DMP6 program.

I'm missing the code of that program. Most Arduino libraries and examples have the first I2C bus hard wired, so you have to modify the library if you want to use the second bus. As we have no information about what libraries or other code you're using, we cannot help you any further.