Is it really impossible to set the STM32 MCU UART for 9-O-2 or 9-O-1 ?
As stated, it is not possible. You might be able to fake such output using SPI
Not that those are prolifically used, this sounds like a pretty niche configuration based on some other hardware in that space.
The USART can send 9 data bits, including parity and up to 2 stop bits.
You can bitbash using a port pin. using a timer interrupt.
what baud rate ?
if the baud rate is high, then you will have to use the ouputCompare function of a timer pin to set the pin in advance of the bit boundary.
initialise timer interrupt for 1 bit time, set the pin high and set the pin to toggle on OC event. this will send the start bit at the instant of the timer interrupt.
then set the next transition to be high or low, and reset the OC trigger.
but I don't think you could go above 115200. without using 50% of the cpu time.
Retrieving data ...