cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX 4.14.0, USART AND UART

Sammalisto.Pauli
Associate II
Posted on April 03, 2016 at 13:45

I generated code with CubeMX 4.14.0 for STM32F4 USART1. What I got is mainly for UART.

In stm32f4xx_hal_conf.h, UART module is included, not USART

&sharpdefine HAL_UART_MODULE_ENABLED

//&sharpdefine HAL_USART_MODULE_ENABLED

In stm32f4xx_hal_uart.h, there is HwFlowCtl, although UART has no flow control. This has been taken care of in the code:

/* Check the parameters */

if(huart->Init.HwFlowCtl != UART_HWCONTROL_NONE)

{

/* The hardware flow control is available only for USART1, USART2, USART3 and USART6 */

assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance));

assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl));

}

Flow control belongs to USARTs, but that is missing in USART_InitTypeDef.

Have I misunderstood something or are there still that kind of bugs in version 4.14.0

#stm32cubemx
1 REPLY 1
slimen
Senior
Posted on April 04, 2016 at 19:05

Hello,

This is not a bug, but it's related to selected mode:

- If  selected synchronous mode; USART is enabled.

- If asynchronous mode, UART is enabled.

-ForumSTM32-