STM32F4 UART extra byte sent at startup
Hi all,
I'm running an application where I got to initialize an UART (by interruption) transmission at power up . So I'm a initializing like this :
HAL_UART_MspInit(&huart5);
MX_UART5_Init();There are the basic functions from STM32 Cube MX...
When the product has power up, I need to send data immediatly.
To send the data, I am using a buffer, before I send something I reset the buffer then I fill it with my data.
The problem is that when I power up my product, I have a random byte sent in the UART (this byte can be 0xFF, 0xBF, 0xFD) and then my buffer is sent. The failure rate is around 5% on 1000 tries. Can someone help me or explain me why it happens ?
I know this problem exists from this post https://github.com/RIOT-OS/RIOT/issues/8045 but I still don't know how to solve it.
Thanks in advance.