2023-05-24 07:21 AM
I did the USART configuration as mentioned in AN4908. However, the UART_FLAG_ABRF flag is always reset.
2023-05-24 09:11 AM
Not sure your presentation is sufficient to understand or replicate what you tried.
Have you reviewed the problem in the context of the Reference Manual?
2023-05-24 09:21 AM
hi, sure! i have set the config as defined below:
/*##-2- Configure the AutoBaudRate method */ UartHandle.AdvancedInit.AdvFeatureInit =UART_ADVFEATURE_AUTOBAUDRATE_INIT; UartHandle.AdvancedInit.AutoBaudRateEnable = UART_ADVFEATURE_AUTOBAUDRATE_ENABLE; /*Uncomment your appropriate mode */ //UartHandle.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT; //UartHandle.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE; //UartHandle.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME; //UartHandle.AdvancedInit.AutoBaudRateMode = UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME; if (HAL_UART_Init(&UartHandle) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /* Wait until Receive enable acknowledge flag is set */ while(__HAL_UART_GET_FLAG(&UartHandle,UART_FLAG_REACK) == RESET) {} /* Wait until Transmit enable acknowledge flag is set */ while(__HAL_UART_GET_FLAG(&UartHandle,UART_FLAG_TEACK) == RESET) {} /* Loop until the end of Autobaudrate phase */ while(__HAL_UART_GET_FLAG(&UartHandle,UART_FLAG_ABRF) == RESET) {}
However the UART_FLAG_ABRF flag is always reset ! so this loop is blocked!
2023-10-19 09:10 AM
Hello,
Your configuration is OK! However, the receiver waits for the first character on the RX line (coming from the transmitter) which should be the frame 0x7F. Then it calculates the baud and updates the BRR by hardware.
The operation's completion is signaled by ABREF flag being set to 1.
So, make sure that the frame was sent correctly by transmitter by checking the TDR register.
Kind regards,