PA9 is high voltage level when configured as input pull-down mode
Hello, everyone.
I use STM32L496 on my board, and use PA9 as a GPIO for input, without any external resister.
Software program is based on HAL. I have a sample demo like this:
int main(void)
{
HAL_Init();
BSP_Init();
while(1)
{
delay_ms(1000);
}
}
While, in the BSP_Init(), like this:
void BSP_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL; // or GPIO_PULLDOWN
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
But, on the board, I measured PA9 has a high voltage level, but PA10 and PA11 is low. If do not call BSP_Init(), PA9 is high level,too. If a change GPIO_InitStruct.Pull to GPIO_PULLDOWN, the result is same as above. I checked the register, three pin has the same configure. And no other place configure these pin.
Is there same mistake about my use? It's been bothering me for a long time. Does anyone provide any help, Thanks very much!


