2020-04-06 07: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
2020-04-06 07:30 PM
I see a command: __HAL_RCC_USART2_CLK_ENABLE
but that is for the USART2, not UART2.
2020-04-06 08: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.
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
2020-04-07 01: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
2020-04-07 02:30 PM
I forgot to add that I am using the Nucleo-F446RE Board.
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.
2020-04-08 10:37 AM
Thank you very much. I finally got things working.
2020-04-08 11:45 AM