The MOSI pin of SPI1 on STM32L073 is not giving output without pull-up resistor
We found the problem which is we did not connect VDD_USB to VDD. Because PA11 and PA12 pins can be used as I/O only if VDD_USB pin is supplied between VDD_min and VDD_max.