Skip to main content
JLIND.1
Associate III
April 7, 2020
Question

Enable the UART2 Peripheral Clock

  • April 7, 2020
  • 2 replies
  • 3342 views

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.

2 replies

JLIND.1
JLIND.1Author
Associate III
April 7, 2020

I see a command: __HAL_RCC_USART2_CLK_ENABLE

but that is for the USART2, not UART2.

Tesla DeLorean
Guru
April 7, 2020

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 VenmoUp vote any posts that you find helpful, it shows what's working..
JLIND.1
JLIND.1Author
Associate III
April 7, 2020

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
April 8, 2020
JLIND.1
JLIND.1Author
Associate III
April 8, 2020

Thank you very much. I finally got things working.