I have RS-485 transceiver connected to USART1 (PA9 + PA10) and relay connected to PB4. If MCU have erased FLASH or RST-pin connected to GND all incoming data to pin PA10 (Rx) for RS-485 line translated to pin PB4 in inversion (0 on PA10 => 1 on PB4, ...