2019-11-04 01:57 AM
Dear community,
I've been playing with the STM32L4R9I-Eval board and it seems that I can't drive the PG9 pin.
My plan is to use the UART1 with the following pins:
I checked the documentation and to use PG9 you have to:
I did that changes and it seems that the uC still can't drive the PG9 pin. I'm checking with an oscilloscope on the connector CN14. Before initializing the UART I added a routine to set/reset the pins few times and it seems that the PG9 can't be driven by the uC.
I enabled the clock to the port G and configure the GPIO as all the others, but still can't drive it.
Any clue on what can be possible wrong?
2019-11-04 04:04 AM
One more information about it, I'm using the HAL lib. This is what I'm doing:
__HAL_RCC_GPIOG_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
while(1)
{
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
}
I removed the code to all the other pins, so the code works.
2019-11-04 04:25 AM
GPIO G bank must have VCCIO explicitly enabled.
2019-11-04 04:59 AM
Hi @Community member
Thanks for the reply. I tried your suggestion and there's still no changes :(
According to my CubeMX project, the following should be done:
So I added that on my initialization:
__HAL_RCC_GPIOG_CLK_ENABLE();
HAL_PWREx_EnableVddIO2();
... same stuff as before
Still no output on the PG9.
2019-11-04 06:20 AM
PWR clock was enabled before that command? Read back the related register in debugger and check.
Is the VDDIO2 pin physically connected to power supply?
JW
2019-11-05 11:06 PM
Hi @Community member
The VDDIO2 pin is physically connected to the power supply.
Now it's working, it was missing the enable PWR clock call.
Thank you very much guys.