2024-07-19 12:01 AM
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!
Solved! Go to Solution.
2024-07-19 12:13 AM - edited 2024-07-19 12:21 AM
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:
So : no USB here, until you have a crystal/HSE and 3V VDD supply .
2024-07-19 12:13 AM - edited 2024-07-19 12:21 AM
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:
So : no USB here, until you have a crystal/HSE and 3V VDD supply .
2024-07-19 12:16 AM
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!
2024-07-19 12:26 AM
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.