How to keep uart RX interrupt enabled forever using HAL library on a STM32F1
<p>I see HAL provides the following function for receiving serial data with interrupts: <code>HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)</code><br>
which basically setups rx interrupts and returns.<br>
<code>HAL_UART_RxCpltCallback()</code> will be called once the amount of bytes received reaches <code>Size</code>.<br>
HAL disables rx interrupts just before executing this callback<br><br>
<strong>Problem:</strong><br>
The amount of incoming bytes will be variable (from 1 to ~100) and I need to put them into a ring buffer.
 <br> 
So I set <code>Size</code> to 1 and call <code>HAL_UART_Receive_IT()</code> again inside the callback to re-enable interrupts, and it works well if the board gets sent 1 or 2 bytes every now and then, but bytes are missed beyond that</p>

<p>My guess is they are missed because they arrive between interrupt disabling - enabling </p>

<p>Is there a way to keep interrupts running forever without overwriting HAL Cube generated code?<br>
If not, what would be a clean way of overwriting the involved functions?
<br>Is there something I'm missing that would avoid the need to find this solution?</p>