cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get STM32G0B1VE USB device work.

Jackle
Associate III

I use STM32CubeIDE1.6.1 to generate USB device (CDC VCP mode) code for STM32G0B1VE. The PC could not recognize the USB. I tried internal HSI48 clock and PLLQ for USB (clock frequency verified by MCO), I pulled up DP through 1.5k resistor by a GPIO after about 2 seconds once starting the code. I'm using Windows 10. Please help!

@Imen DAHMEN​ 

38 REPLIES 38

I have STM32F373VBT.

But also I have solder two USB cables together because my local store did not have USB female to USB female.

Sometimes I get connection. So perhaps...it's a bad USB cabel because I get connections some times.

Like now...I have connection. (I moved on the cable ). Now it seems to work every time. Just because I moved on the cable. So I think you have a bad USB cable. Notice that USB cable is very sensitive because it's parallell signals.

0693W00000BcyQOQAZ.png

My cable is s-hit like crap. I cut it to half and solder it with another cable so I could have female to female USB.

I'm building my own boards from scratch.

But it seems to work now, when I moved the cable.

I plug it out, plug it in. Yes...connection.

If you want. I can give you my project if you have a STM32F373VBT uC?

Now when I thinking of it!

Yes! The board need first connection because the uC is tooo fast.

If I unplug the USB cable completly, then USB connection wont establish.

But if I just drag the USB cable out 2-3 mm, but still have current source connection to my uC, then press the USB plug in again.

Then I get USB connection 🙂

Thank you!

You're welcome. I'm using a new released uC. The software pack is not perfect yet. Wish me luck!

By the way!

It works much better if I place MX_USB_DEVICE_Init(); closer to MX_GPIO_Init. Then I will have connection directly when I plug it into the PC.

@Imen DAHMEN​ 

ST should consider to think about that?

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USB_DEVICE_Init(); <------ here
  MX_DAC1_Init();
  MX_DAC2_Init();
  MX_RTC_Init();
  MX_SPI2_Init();
  MX_TIM2_Init();
  MX_TIM5_Init();
  MX_SPI1_Init();
  MX_TIM4_Init();
  MX_SDADC1_Init();
  MX_SDADC2_Init();
  MX_SDADC3_Init();
  MX_TIM19_Init();
  MX_CAN_Init();
  MX_USART1_UART_Init();
  MX_TIM6_Init();
  MX_TIM12_Init();
  MX_TIM13_Init();
  MX_TIM16_Init();
  //MX_USB_DEVICE_Init(); <--- Move this up!
  MX_FATFS_Init();
  MX_TIM14_Init();
  /* USER CODE BEGIN 2 */

My apologize for the delay I take to answer sometimes, as I'm busy this period.

I raised your feedback internally to CubeMx team for check and analysis.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

I'm looking forward to seeing the result. Appreciate your help. @Imen DAHMEN​ 

Amin.TAYEBI
Associate II

Hi friend.my suggestion is to test your scenario in another PC, or you can use virtual box and install virtual windows or linux and test your scenario then if there it works or not.

It has been tested on two different pcs windows 7 and windows 10. No luck.