STM32 UART How to receive 9 bit?
If you are trying to stuff 9 bits of data into an 8 bit integer, that simply wont work. The compiler would likely cut off the 9th bit, or complain you didn't pass it an array.

You will need to pass it an array of 8 bit integers large enough to capture your received data. In this case, you would need 2 8 bit integers, giving you 16 bits of bit-space for the API to stuff its 9 bits into. The HAL function will write to both integers in the array you passed it. You will need to apply some fancy bit-masking and typecasting to massage the buffer into a native type, or decompose it further into whatever schema you have devised.