Send Data With Usart STM32
The STM UART interface can only send 8 or 16 bit in one step. For that reason the HAL_UART_Transmit can also only take uint8 or uint16 chunks.
If you have to send the 32 bit of a float you can pass each byte of the float and send them as single bytes. The receiver has to interpret them as a float again.

To send the four bytes of the float individually just pass a pointer to the float with a cast to (uint8_t*) and tell the function to send four bytes:
float msg = xy;
HAL_UART_Transmit(&amp;huart2, (uint8_t *)msg, sizeof(msg), HAL_MAX_DELAY);