2021-03-18 05:30 AM
This error callback function is not getting called when we connect to PC. But we are getting during modem (UART based)communication only. Whats purpose of this callback ? Is there any configuration need to add ?
2021-03-30 05:55 AM
Are you sure?
Overrun is usually a receive error - meaning that you aren't processing the received data fast enough.
2021-03-30 10:21 AM
Please check attached snap where we are transmitting and receiving data between Modem and STM32.
Let us know what is best way to handle this receive buffer.
2021-03-30 11:34 AM
Surely the idea for using the IT methods would be that you can receive and transmit concurrently (full-duplex), not that you move the blocking loop into your main() loop.
Is RecvTick a volatile? Are you sure the spin loop isn't optimized out?
You really need to use the IT methods to manage buffers that you can then inspect and process asynchronously within your loop.
I'd freely admit the HAL UART implementation is a bit of a goat rodeo, but you can review the Reference Manual, and USART section to better understand the mechanics, and code something more effective.
2021-03-30 03:59 PM
Hello
In the above code if rx wait loop completed without timeout then NumStage will get the value 2 but this case "case 2:" never implemented .
2021-03-31 03:00 AM
Not as an image!
2021-03-31 03:39 AM
if(HAL_UART_Transmit_IT(&UartHandle, (uint8_t*)txbuff, TxBufLen)!= HAL_OK)
{
Error_Handler();
}
RecvTick = RESET;
/*##-3- Wait for the end of the transfer #################################*/
while (UartReady != SET && RecvTick++ < 50000)
{
}
/* Reset transmission flag */
UartReady = RESET;
/*##-4- Put UART peripheral in reception process ###########################*/
if(HAL_UART_Receive_IT(&UartHandle, (uint8_t *)aRxBuffer, 6) != HAL_OK)
{
Error_Handler();
}
RecvTick = RESET;
/*##-5- Wait for the end of the transfer ###################################*/
while (UartReady != SET && RecvTick++ < 50000)
{
}
/* Reset transmission flag */
UartReady = RESET;
This is snippet of code.