Enable the UART2 Peripheral Clock
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-06 7:15 PM
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
- Labels:
-
STM32CubeIDE
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-06 7:30 PM
I see a command: __HAL_RCC_USART2_CLK_ENABLE
but that is for the USART2, not UART2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-06 8:24 PM
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-07 11:52 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-07 1:31 PM
Could you help me one more time. What is the equivalent HAL command for :
GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF7_USART2)
GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF7_USART3)
I'm trying to set up the Alternate Function for pins 2 and 3.
Can you please help me.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-07 2:30 PM
I forgot to add that I am using the Nucleo-F446RE Board.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-07 10:46 PM
HAL doesn't have direct equivalent, but the functionality is provided by HAL_GPIO_Init().
A closer equivalents are LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15() from LL driver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-08 10:37 AM
Thank you very much. I finally got things working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-08 11:45 AM
Up vote any posts that you find helpful, it shows what's working..
