2019-08-28 03:31 AM
Hello,
I use STM32F407 and I wanna config virtual com port on my board using CubeMX,
but I always get error 43, I saw many topics, my stack size is 0x4000 and heap size is 0x2000.
I tried to change max packet size, reinstall stm32 vcp drivers, but nothing changes
I use cube 5.3.0, and FW package F4 V1.24.1.
And I think the problem is in Cube, because I made the same project like a half year ago and it works now on the same board.
Do you have the same problem?
Thank you,
Anton
Solved! Go to Solution.
2019-08-29 12:06 AM
@Lubos KOUDELKA
I am sorry it is my fault,
I use my custom board with quartz crystal unit for 16 MHz, and I didn't pay attention that Cube generates project with input freq = 25 MHz,
that's the problem, now it solved.
thank you for the help,
Anton
2019-08-28 04:10 AM
Hello Anton,
I just tried generate USB CDC device on STM32F407 discovery board. Worked for me without any issue with same version of CubeMX and library package you use. Generated example attached, please try also on your side. After project generation was added only line coding handling and echo functionality in usbd_cdc_if.c.
Best regards,
Lubos
2019-08-28 06:20 AM
2019-08-28 06:50 AM
Hello Anton,
I see you're using VBUS sensing feature of PA9. Correct connect of VBUS sensing is covered in FAQ: https://community.st.com/s/article/FAQ-Management-of-VBUS-sensing-for-USB-device-design
For quick testing you can try to disable VBUS sensing in CubeMX or directly in code - in usbd_conf.c modify hpcd_USB_OTG_FS.Init.vbus_sensing_enable to DISABLE.
Lubos
2019-08-29 12:06 AM
@Lubos KOUDELKA
I am sorry it is my fault,
I use my custom board with quartz crystal unit for 16 MHz, and I didn't pay attention that Cube generates project with input freq = 25 MHz,
that's the problem, now it solved.
thank you for the help,
Anton
2021-06-18 01:35 AM
qqAnton you my HERO! I have the same issues! My board use 8 MHz cry, but MXCube set 25 Mhz. I didn’t notice it