USART3 offset bytes when receive for the first time after boot
Hello,
I am using a nucleoH743ZI2 and STM32CubeIDE v1.13.2 on windows10
I configured the USART 3 in order to receive some telecommands from my laptop (windows 10) using a software (HTerm v0.8.9)


The telecommands are written in binary, 52 bytes, but the first 8 bytes are ASCII so I can read it directly, for example the keyword "C0FFEE5\0"
I intialize my callback with DMA:
char UART3_rxBuffer[UART_DMAsize]={0};
HAL_UART_Receive_DMA (&huart3, &(UART3_rxBuffer[0]), (uint16_t) UART_DMAsize);
And in a while(true) loop and I am reading every 3 seconds what is inside my buffer which receives TC by UART:
char configReceived[sizeof(TypeReadConfig)];
memcpy(configReceived, &(UART3_rxBuffer[0]),sizeof(TypeReadConfig));
printf("##++ ConfigReceived %d\r\n",sizeof(TypeReadConfig));
for(indice=0;indice<sizeof(TypeReadConfig);indice++){
printf("%c",configReceived[indice]);
}
printf("\r\n##++ End ConfigReceived\r\n");
I noticed that if I flash my code, and send my TC of 52 bytes,
the C0FFEE5 keyword start at index 0 of my buffer.
And if I send again, the keyword will start at index 0.
If I hit the hard reset button on the Nucleo car, it will also starts at index 0.
##++ ConfigReceived <\r><\n>
C0FFEE5<\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\r><\n>
##++ End ConfigReceived<\r><\n>
However, if I unplug my Nucleo, plug it again, and send my TC, the keyword starts at index +1,
as a result my callback is not called because the buffer was not filled completely.
In this state I cannot make it work again, I have to hard reset the Nucleo so the keyword starts at 0.
##++ ConfigReceived <\r><\n>
<\0>C0FFEE5<\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\0><\r><\n>
##++ End ConfigReceived<\r><\n>
Why is there a different behavior between flash/reset and start on power ?
How can I force the index to 0, know that the same code will behave differently according how I started the card?
