HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) behavior
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-29 4:18 AM
I'm not using the internal autobaud system.
but i do try to catch wrong baudrate's by monitoring the ORE flag.
The ORE flag is never '1' when i run the program full speed, but when i add a breakpoint in the callback and step ORE is flagged correctly ?
Why does ORE not flag at full speed? Are there other ways to catch a wrong baudrate ?
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart){
isrreg[isregcnt++] = eic.phuart->Instance->ISR;
if(isregcnt>30) isregcnt=29;
if ((eic.phuart->Instance == huart->Instance)) {
if ((eic.phuart->Instance->ISR & USART_ISR_ORE) != 0) {
bBaudError=1;
}
}
HAL_UARTEx_ReceiveToIdle_DMA(huart,(uint8_t*)eic.DMABuff,DMABUFF_SIZE);
__HAL_DMA_DISABLE_IT(eic.phdma_usart_rx,DMA_IT_HT);
}
Thank you
Steve
Labels:
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-29 6:31 AM
Flags are cleared prior to the HAL callbacks. Look for the error reason in the ErrorCode member.
huart->ErrorCode |= HAL_UART_ERROR_ORE;
If you feel a post has answered your question, please click "Accept as Solution".
