2025-01-08 02:11 AM - last edited on 2025-01-08 03:27 AM by Andrew Neil
Hi evryone,
I'm trying to initialise a very basic UART communication between my stm32 L552ZE-Q and my computer by following this tutorial: https://www.youtube.com/watch?v=dEQwSl8mCFs&t=924s
I have no errors, no warning while compiling and the problem is that there is nothing displayed on the PuTTy teminal. I also used TeraTerm and VScode serial terminal and nothing happened. I tried also on an other computer and same problem.
I have upgraded the code by adding a blinking LED to verify if something is even running and the LED is blinking but again nothing on Putty...
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&huart2, tx_buffer, 27, 10);
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_9);
HAL_Delay(1000);
}
I've checked the COM port used in my device manager and set the correct Baud rate, I don't know to do next.
Thank you for your help!
Louis
2025-01-08 02:20 AM
@_Louis_ wrote:
So you're using the Virtual COM Port (VCP) in an ST-Link.
What board are you using?
Are you sure that you are using the correct UART - the one that's actually connected to the VCP?
2025-01-08 06:56 AM
Not clear how you're initailizing the UART and Pins on the NUCLEO-L552ZE-Q
Doesn't it use LPUART1 on PG7 / PG8? And not USART2
So you'd also have to enable the VDDIO2 for GPIOG
Show code..
2025-01-08 05:36 PM
Hi Andrew,
I'm using the NUCLE-L552ZE-Q board.
Are you sure that you are using the correct UART - the one that's actually connected to the VCP?
I don't really know, I'm trying to follow the tutorial and adapt it to my board so I have that on the .ioc file:
The VCP_RX/TX are in reset state so you say that I should try to enable them?
2025-01-08 05:47 PM
Hi,
I initialized the UART and pins via the .ioc file, Connectivity -> USART2 -> Mode: Asynchronous and NVIC Settings to activate the USART2 global interrupt as done in the tutorial I follow.
@Tesla DeLorean wrote:Doesn't it use LPUART1 on PG7 / PG8? And not USART2
PA2 an PA3 are configured respectively in USART_TX an USART_RX states and PG7/8 are in reset state.
@Tesla DeLorean wrote:So you'd also have to enable the VDDIO2 for GPIOG
What is it for and how can I do that?
@Tesla DeLorean wrote:Show code..
Do you want any specific part or file or I just dump it there for you?
Thank for your time and help!
2025-01-08 06:02 PM
@_Louis_ wrote:I'm using the NUCLE-L552ZE-Q board.
So look at its User Manual to see which UART is connected to the ST-Link's VCP:
As you can see, it's LPUART1 (on PG7, PG8) which is connected to the ST-LINK's VCP
2025-01-08 06:04 PM
@_Louis_ wrote:I initialized the UART and pins via the .ioc file, Connectivity -> USART2
That's the wrong UART!
2025-01-08 06:52 PM
Oh thanks, I've seen that in the user manual but I can modify the LPUART1in the .ioc:
Do you know how can I access the parameters?
I can ste the pin manually but will it be enough?
2025-01-08 06:57 PM
There seems to be an issue with STM32CubeIDE when trying to enable LPUART1.
As you can see, PG7 and PG8 are in reset state. When selecting LPUART1, the configurations are grayed out so you can't change the Mode.