Sorry if this seems a stupid question but I'm designing a custom PCB based on the STM32F303RE microcontroller and am slightly confused as to how the UART should be connected in the hardware in order to communicate via serial over USB.
I have a microUSB connector on board, should the UART pins be connected directly to this connector? Or do I need to use the USB pins on the STM32 and set up the micro controller as a USB device and connect the UART to these pins somehow (or not use them at all)?
I started with a Nucleo board for development and can communicate via UART on there (using HAL UART functions) but looking at the schematic is confusing due to the on-board ST-LINK. As far as I can see, the UART signal of the STM32 is passed to the UART pins of the ST-LINK MCU and the USB pins of the ST-LINK MCU are connected to the MicroUSB port but I'm not sure how the data is passed through? Is it in fact using the USB HAL functions to convert the received UART data?