Receiving more than one byte for HAL_UART_Receive
I'm a bit confused on how to receive data with multiple bytes and store it to some buffer on the stm32 microcontroller?
Currently I have a python script that will send the data over uart serial "serial.Serial.write(b'4215'))"
Then I have a UART interrupt in my main loop that will capture only the first number but I have not been able to see the 215 when in debugging mode.
Just going to write the relevant code below since everything seems to be working right it's just I can't get more than one byte.
Any feedback is much appreciated! Let me know if I need to provide more information!
uint8_t Rx_buffer[100];
uint8_t msg_r_data[7];
uint8_t rx_indx = 0;
uint8_t msg_r_buffer[100];
....
while (1)
{
HAL_UART_Receive_IT(&hlpuart1, Rx_buffer, 4);
...
...
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if (huart -> Instance == LPUART1) {
msg_r_data[rx_indx++] = Rx_buffer[0];
}
}
