Configuring pins PA5 or PA6 as output push-pull pins on STM32L432KC causes I2C1 peripheral to stall
I'm using STM32L432KC on Nucleo-L432KC board with the following set up:
I2C -- PB6=I2C1_SCL, PB7=I2C1_SDA
SPI -- PA1=SPI1_SCK, PA11=SPI1_MISO, PA12=SPI1_MOSI, PB0=software CS for SD card reader
EXTI - PB1=EXTI1
It all works fine until I want to configure another CS pin for second SPI device using PA6 or PA5.
Please note that nothing is connected yet, I am merely configuring a new PIN in this way - as push-pull, pull-up, and outputting high:
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
/*Configure GPIO pin : PA5 */
GPIO_InitStruct.Pin = GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; // Change to GPIO_MODE_OUTPUT_OD
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);This I have isolated to cause I2C1 peripheral to hang (waiting for TC flag to be cleared) while taking with the connected devices.
I have noticed the following:
If I apply the exact same configuration (push-pull) which causes issue on PA5 to e.g. PB5 instead then I2C1 works fine.
If I change PA5 or PA6 configuration to use open-drain instead of push-pull then again I2C1 starts working fine.
So the questions are:
* Is this buggy behaviour that unrelated pin that isn't even connected to anything yet causes an unrelated device to stall?
(My assumption is that GPIO pins should not impact functioning of I2C peripheral which uses pins on a different PORT? Or are there any special cases?)
* Is there any particular reason why push-pull configuration causes this hang while open-drain configuration does not?
