Stm32 how select i2c2 how connect timer to port

STM32f103C8, framework Arduino

Wire.setSDA(pin) e Wire.setSCL(pin) are just to remape I2C1 (PB6,PB7 → PB8,PB9) but not I2C2 an I am not able to discover how use I2C2 (PB10,PB11).

The second question is haw to output TIM4_CH1 on PB6
It generate a  pulse long TIM4_CCIR1 every TIM4_ARR
``
void setup() {
pinMode(PB6,  PWM);     // THIS IS WRONG

TIM4->CR1 = TIM_CR1_CEN |TIM_CR1_ARPE;
TIM4->CR2 = 0;
TIM4->SMCR = 0;
TIM4->DIER = 0;
TIM4->EGR = 0;
TIM4->CCMR1 = (0b110 << 4 ) | TIM_CCMR1_OC1PE;
TIM4->CCMR2 = 0;
TIM4->CCER = TIM_CCER_CC1E ;
TIM4->PSC = 71;
TIM4->ARR = 0x5000;
TIM4->DCR = 0;
TIM4->CCR1 = 1000;
}

t
With Arduino and Roger Clark’s board manager Pin mode(PB6, PWM) is OK and connecting timer to port

Hopping for an help

I solved the fist question. It was an error bloking I2C. For peolpe having problems like me; if you want selec I2C this is the way.

#include <Wire>

  Wire.setSDA(PB11); // Set SDA to PB11
  Wire.setSCL(PB10); // Set SCL to PB10 
  Wire.begin();
  Wire.setClock(400000);  // Set I2C frequency to 400kHz

You have to select ports SDA and SCL before Wire,begin