2020-03-24 03:36 AM
we configture the STM32 via STM32 IDE, the uart is configured to 115200 8-N-1 mode. but we receive the data via PC USB-uart. the PC tools configure to 115200 7-Space-1 mode to correct receive the data. if we configure to 115200 8-NONE-1 in PC side. the data received is wrong.
we used the STM32Fx MCU, there has not the issue. but we use the H742, there has the issue. we do not how to configure, the PC can use 8-N-1 mode to receive the correct data.
the init code as here:
huart3.Instance = USART3;
huart3.Init.BaudRate = 115200;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.Mode = UART_MODE_TX_RX;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart3.Init.OverSampling = UART_OVERSAMPLING_16;
huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_ENABLE;
huart3.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}