Skip to main content
dungeonlords789
Associate III
September 17, 2020
Question

Incorrect code generation for UART5 of F767

  • September 17, 2020
  • 10 replies
  • 2505 views

I generate code for stm32f767. I use software package 1.16.0 I want to use UART5 in auto baud mode via 0x55 symbol. And USART3 the same. Why code is different?

static void MX_UART5_Init(void){
 /* USER CODE BEGIN UART5_Init 0 */
 /* USER CODE END UART5_Init 0 */
 /* USER CODE BEGIN UART5_Init 1 */
 /* USER CODE END UART5_Init 1 */
 huart5.Instance = UART5;
 huart5.Init.BaudRate = 115200;
 huart5.Init.WordLength = UART_WORDLENGTH_9B;
 huart5.Init.StopBits = UART_STOPBITS_1;
 huart5.Init.Parity = UART_PARITY_EVEN;
 huart5.Init.Mode = UART_MODE_TX_RX;
 huart5.Init.HwFlowCtl = UART_HWCONTROL_NONE;
 huart5.Init.OverSampling = UART_OVERSAMPLING_16;
 huart5.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
 huart5.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;//wtf? ABRMOD0 and ABRMOD1 and ABREN will be 0
 huart5.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME;
 
 if (HAL_UART_Init(&huart5) != HAL_OK){
 Error_Handler();
 }
 
 /* USER CODE BEGIN UART5_Init 2 */
 /* USER CODE END UART5_Init 2 */
}

This is ok code for USART3:

static void MX_USART3_UART_Init(void){
 /* USER CODE BEGIN USART3_Init 0 */
 /* USER CODE END USART3_Init 0 */
 /* USER CODE BEGIN USART3_Init 1 */
 /* USER CODE END USART3_Init 1 */
 
 huart3.Instance = USART3;
 
 huart3.Init.BaudRate = 115200;
 
 huart3.Init.WordLength = UART_WORDLENGTH_9B;
 
 huart3.Init.StopBits = UART_STOPBITS_1;
 
 huart3.Init.Parity = UART_PARITY_EVEN;
 
 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_DISABLE;
 
 huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_AUTOBAUDRATE_INIT;//looks ok
 
 huart3.AdvancedInit.AutoBaudRateEnable = UART_ADVFEATURE_AUTOBAUDRATE_ENABLE;
 
 huart3.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME;
 
 if (HAL_UART_Init(&huart3) != HAL_OK)
 
 {
 
 Error_Handler();
 
 }

This topic has been closed for replies.

10 replies

Khouloud OTHMAN
Associate
September 22, 2020

Hello dungeonlords789,

Thank you for your post . Issue confirmed and raised internally for correction. We will give you an update as soon as possible.

Regards,

Khouloud.

dungeonlords789
Associate III
October 16, 2020

@Khouloud OTHMAN​ any questions/solutions?

Khouloud OTHMAN
Associate
October 19, 2020

Hello dungeonlords789,

Sorry for the inconvenience. The problem has been corrected and the fix will be available in the next release.

Thanks for your patience.

Regards,

Khouloud.

dungeonlords789
Associate III
February 25, 2021

Any news? @Khouloud OTHMAN​ 

Khouloud OTHMAN
Associate
February 25, 2021

Hi @dungeonlords789​ ,

Actually this issue has been fixed in the STM32CubeMX version 6.1.0. Did you try with the latest STM32CubeMX version ?

Khouloud.