2021-06-30 06:27 AM
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
Solved! Go to Solution.
2021-07-06 09:08 AM
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.
2021-07-06 09:11 AM
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.
2021-07-06 09:13 AM
If you want. I can give you my project if you have a STM32F373VBT uC?
2021-07-06 09:17 AM
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!
2021-07-06 09:30 AM
You're welcome. I'm using a new released uC. The software pack is not perfect yet. Wish me luck!
2021-07-06 03:13 PM
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 */
2021-07-08 02:23 PM
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
2021-07-09 05:48 AM
I'm looking forward to seeing the result. Appreciate your help. @Imen DAHMEN
2021-07-09 08:09 AM
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.
2021-07-09 08:18 AM
It has been tested on two different pcs windows 7 and windows 10. No luck.