Comparison between uint8_t and String
For the strcmp function and all other string functions the string must be null-terminated. For your example one way to do that would be something like the following to allocate one extra byte in the array and put a null-terminator at the end:

#define RXBUFFERSIZE 1
uint8_t aRxBuffer[RXBUFFERSIZE + 1];
if(HAL_UART_Receive(&amp;huart2, (uint8_t *)aRxBuffer, RXBUFFERSIZE, 0xFFFF) != HAL_OK)
    ....
aRxBuffer[RXBUFFERSIZE] = 0;


Although for a single character compare like you have at the moment there's no need for a string comparison, you could use a character compare on the first and only element of the array:

if (aRxBuffer[0] == 'Y')
    DoSomething();
else
    DoSomethingElse();