AnsweredAssumed Answered

stm32f767 usart2

Question asked by Vaclav Zajic on May 22, 2018
Latest reply on May 23, 2018 by Vaclav Zajic

Hello, 

 

I can not get usart2 working in asynchronous mode on STM32f767zi-nucleo.

 

My clock configuration function contains

 

PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART2|RCC_PERIPHCLK_USART3|RCC_PERIPHCLK_CLK48;
PeriphClkInitStruct.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;

 

In main() I call 

 

static void MX_USART2_UART_Init(void)
{

huart2.Instance = USART2;
huart2.Init.BaudRate = 115200;
huart2.Init.WordLength = /*UART_WORDLENGTH_7B*/UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart2) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}

}

 

When I try to send something to USART2 with HAL_UART_Transmit I get return code HAL_OK, but I can't  see anything on serial port.

 

Can you give me an advice?

 

Thank you

 

Vaclav 

Outcomes