I'm using an STM32F103C8T6 (aka blue pill) with Eclipse/System Workbench and HAL.
The following code:
volatile HAL_StatusTypeDef result = HAL_UART_Transmit(&huart1, bytesToSend + currentSendIndex, bytesPerMessageToSend, 100); volatile uint32_t error = HAL_UART_GetError(&huart1);
works fine when sending 1 byte, and (later) receiving 1 byte and iterating this.
However, when sending 3 bytes, I noticed, I only receive the first byte, and the next calls for HAL_UART_Receive result in a timeout.
This seems logical, because probably there is only 1 byte buffer in the UART.
However, what I don't understand, why does transmitting multiple bytes in the code mentioned, returns HAL_OK, and also the call to HAL_UART_GetError returns 0.
I assume an overrun has occurred for the 2nd and consecutive bytes... is this true, and if yes, how can I check this?