2019-09-09 01:56 AM
Hi Team,
I am using stm32h753 controller, While receiveing data in the UART. Rx buffer index is not always Rxbuff[0]. Data is received randomly in the different index.
Here i am attaching the reference.
Solved! Go to Solution.
2019-09-09 03:58 AM
Hi Clive,
Please find the code..
buffer size in 250 .
I am receiving 16 byte data.
2019-09-09 01:59 AM
Can you post the code how you receive data? It is unclear from your print screen.
2019-09-09 02:50 AM
Hi, Tilen MAJERLE,
Please find the code...
2019-09-09 03:06 AM
Can't you just paste more complete code?
How large is the buffer?
You ignore error status from the function.
You ignore the fact data reception may be of different sizes, or shift in alignment/synchronization.
2019-09-09 03:58 AM
Hi Clive,
Please find the code..
buffer size in 250 .
I am receiving 16 byte data.
2019-09-09 04:09 AM
HAL_UART_Receive length parameter accepts number of bytes to receive. You put size of buffer, put 16 instead and function will terminate after it receives 16 bytes.
2019-09-09 04:29 AM
Hi Tilen,
If i want to change the buffer size, each time i don't want to change it manually. How it can be done with out giving specific value to it.
One Note:-
The given code passing array buffer index was mentioned.
HAL_UART_Receive(&huart2, (uint8_t *)rxdata[0], sizeof(rxdata), 1000);
correct one:-
HAL_UART_Receive(&huart2, (uint8_t *)rxdata, sizeof(rxdata), 1000);
2019-09-09 11:20 PM
Hi Tilen,
As of now , i am try to change the receive buffer size equal to transmit buffer size(16 byte). Till i am facing the same issue. I am using USART in Asynchronism mode.