Solved
STM32L152 GPIO Configuration
Hi,
I would like to control a GPS module reset pin thru STM32L152. The reference circuit of the GPS module reset pin as per attached picture. According to the GPS data sheet, the reset pin "Only drive with open collector, no external voltage to be applied".

How should I configure my GPIO connected to the reset pin? I tried this but it doesn't seem to work:
// GPIO initialisation
GPIO_InitTypeDef GPIO_InitStruct;
// Enable clock for GPIOC
__HAL_RCC_GPIOC_CLK_ENABLE();
// Initialise watchdog pin
GPIO_InitStruct.Pin = GPS_RESET_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOC, GPS_RESET_PIN, GPIO_PIN_SET);
HAL_Delay(100);
HAL_GPIO_WritePin(GPIOC, GPS_RESET_PIN, GPIO_PIN_RESET);
HAL_Delay(100);Thank you very much!
