How to enable USART driver in CubeMX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 12:55 AM
The code generated by the STM32CubeMX is using the UART rather than the USART.
How do we generate the code using the USART driver lib via the CubeMX?
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 1:35 AM
Hi @Community member​
USART1, USART2, ... and/or UART4 or UART5, ... are instances of peripherals, able to achieve UART/USART communications.
Usually, USARTx instances are able to handle :
- UART comms : Asynchronous communication, no CLK signal
- USART comms : Synchronous, based on a CLK signal
while UARTy instances only handle :
- UART comms : Asynchronous communication, no CLK signal
So depending on what type of communication you want to handle, you need to select the appropriate type in CubeMx configuration :
"Asynchronous" => Use of HAL UART API, UART comm type
"Synchronous" => Use of HAL USART API, USART comm type
Hope this answers your question
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 1:01 AM
Using the STM32L412 with the latest CubMx and Lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 1:25 AM
It's the same driver for both types
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 1:35 AM
Hi @Community member​
USART1, USART2, ... and/or UART4 or UART5, ... are instances of peripherals, able to achieve UART/USART communications.
Usually, USARTx instances are able to handle :
- UART comms : Asynchronous communication, no CLK signal
- USART comms : Synchronous, based on a CLK signal
while UARTy instances only handle :
- UART comms : Asynchronous communication, no CLK signal
So depending on what type of communication you want to handle, you need to select the appropriate type in CubeMx configuration :
"Asynchronous" => Use of HAL UART API, UART comm type
"Synchronous" => Use of HAL USART API, USART comm type
Hope this answers your question
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 6:14 AM
Thanks. Got it. That mean the USART only be used when the synchronous mode selected. If the only asynchronous mode used, the CubeMX will only use the UART lib.
