AnsweredAssumed Answered

STM32L496 I2C1 PA9 PA10 stuck low

Question asked by Theo Hussey on Jun 6, 2018
Latest reply on Jun 6, 2018 by Theo Hussey

I am having problems configuring the I2C1 gpio pins on the STM32L496 on pins PA9 and PA10.

After the gpios are configured the SCL and SDA lines go from a high level to a low level, which is unexpected. After configuration of the I2C peripheral itself the lines remain low and no data can be observed on the lines.

 

I have tried the same configuration using I2C2 on PB10 and PB11 and this works fine with the I2C lines remaining high after gpio configuration, and the peripheral can control the lines.

 

This is my configuration for the GPIO. Is there anything additional I need to enable, or do I have something wrong here?

I have tried configuring the lines as  od outputs and I can toggle the line, so i don't think it is a hardware issue.

 

Thanks

 

LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA);

LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_9, LL_GPIO_MODE_ALTERNATE);
LL_GPIO_SetAFPin_8_15(GPIOA, LL_GPIO_PIN_9, LL_GPIO_AF_4);
LL_GPIO_SetPinSpeed(GPIOA, LL_GPIO_PIN_9, LL_GPIO_SPEED_FREQ_HIGH);
LL_GPIO_SetPinOutputType(GPIOA, LL_GPIO_PIN_9, LL_GPIO_OUTPUT_OPENDRAIN);
LL_GPIO_SetPinPull(GPIOA, LL_GPIO_PIN_9, LL_GPIO_PULL_UP);

LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_10, LL_GPIO_MODE_ALTERNATE);
LL_GPIO_SetAFPin_8_15(GPIOA, LL_GPIO_PIN_10, LL_GPIO_AF_4);
LL_GPIO_SetPinSpeed(GPIOA, LL_GPIO_PIN_10, LL_GPIO_SPEED_FREQ_HIGH);
LL_GPIO_SetPinOutputType(GPIOA, LL_GPIO_PIN_10, LL_GPIO_OUTPUT_OPENDRAIN);
LL_GPIO_SetPinPull(GPIOA, LL_GPIO_PIN_10, LL_GPIO_PULL_UP);

Outcomes