cancel
Showing results for 
Search instead for 
Did you mean: 

custom board with stm32g0 as USB device isn't working

seba21
Associate

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:

seba21_0-1721372076394.png

 

seba21_1-1721372094468.png

And the USB device mode and configuration:

seba21_4-1721372316967.png

 

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:

seba21_2-1721372158767.pngseba21_3-1721372253739.png


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:

seba21_5-1721372447908.png

Thank you all!

 

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief II

Hi,

>How can I get this to work?

Not at all , at 1.8V . 

USB needs 3.3V supply , because signal level is 3v3. 

+

For reliable USB connection usually a crystal as clock source is needed, as given in ds , note:

AScha3_0-1721373607967.png

So : no USB here, until you have a crystal/HSE and 3V VDD supply .

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
AScha.3
Chief II

Hi,

>How can I get this to work?

Not at all , at 1.8V . 

USB needs 3.3V supply , because signal level is 3v3. 

+

For reliable USB connection usually a crystal as clock source is needed, as given in ds , note:

AScha3_0-1721373607967.png

So : no USB here, until you have a crystal/HSE and 3V VDD supply .

If you feel a post has answered your question, please click "Accept as Solution".

I feared this.
I had the same problem with the FDCAN module and I had to use voltage level translators.
Could such an approach work for the USB as well?

Thank you!

Maybe your the first, to try it ... 🙂

(I never seen such a idea , because if want/need USB , usually everybody sets the system to state, where USB is working out of the box. )

And unknown: will the on-chip USB unit work at 1.8V ? This is experimental - try it, but dont be surprised, if its not working at all.

If you feel a post has answered your question, please click "Accept as Solution".