custom board with stm32g0 as USB device isn't working
Hello everyone,
I am working on a custom board equipped with the STM32G0B1RE microcontroller. I did not design this board, but it has the following characteristics:
- the microcontroller is powered at 1.8V,
- the USB pins are enabled with the following configuration:


And the USB device mode and configuration:

On the hardware level, the board does not have any ESD protection, but the USB data lines go directly into the microcontroller, according to the following schematic:


I tried connecting the board to the PC to send data via USB and simply used these two lines of code found online:
#include "usb_device.h"
#include "usbd_cdc_if.h"
....
char *data = "USB CDC\n";
...
int main(void)
{
...
MX_USB_Device_Init();
...
while(1) {
CDC_Transmit_FS(data, strlen(data));
HAL_Delay (1000);
}
}
However, the communication does not work, and the PC always says "USB device not recognized."
How can I get this to work?
PS: unfortunately, the board does not have an HSE but only an HSI. Here is the USB clock tree:

Thank you all!

