cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R9I-EVAL Problems to use UART1 PB7 (rx) and PG9 (tx)

LPers
Associate II

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:

  • PB7 (rx)
  • PG9 (tx).

I checked the documentation and to use PG9 you have to:

  • Remove R236
  • Open SB34

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.

0690X00000ArdKLQAZ.png

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?

5 REPLIES 5
LPers
Associate II

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.

GPIO G bank must have VCCIO explicitly enabled.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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:

0690X00000AreETQAZ.png

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.

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

LPers.847
Associate

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.