Skip to main content
JLIND.1
Associate III
Apr 7, 2020 2:15 AM UTC
Question

Enable the UART2 Peripheral Clock

Hello, I am doing a UART example and I need to find the command to Enable the UART2 Peripheral Clock. I have enabled the GPIO clock:

__HAL_RCC_GPIOA_CLK_ENABLE(); // stm32f4xx_hal_rcc.h

and now I need to enable the UART2 Clock Peripheral.

Can anyone please help me.

Thank you,

Joe

This topic has been closed for replies.

8 replies

JLIND.1
JLIND.1Author
Associate III
Apr 7, 2020 2:30 AM UTC

I see a command: __HAL_RCC_USART2_CLK_ENABLE

but that is for the USART2, not UART2.

Tesla DeLorean
Guru
Apr 7, 2020 3:24 AM UTC

Correct it is USART2, but you're using the simpler async only library​, which supports a subset of functionality common between UART and USART peripheral IP.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
JLIND.1
JLIND.1Author
Associate III
Apr 7, 2020 6:52 PM UTC

Hello, thank you very much for responding to my message. What async library should I be using or is this okay for now?

I am going though a Udemy class on the FreeRTOS: "Mastering RTOS: Hands on FreeRTOS and STM32Fx with Debugging" which is very good course. The course instructor uses the System Workbench IDE and he uses the Standard Peripheral Library but I was not able to download or add in that library so I must do what he is doing but use the HAL libraries. I have attached my first project using Tasks.

Thank you,

Joe

Piranha
Principal III
Apr 8, 2020 5:46 AM UTC
JLIND.1
JLIND.1Author
Associate III
Apr 8, 2020 5:37 PM UTC

Thank you very much. I finally got things working.