cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 Virtual com port error 43

qqAnton
Senior

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

1 ACCEPTED SOLUTION

Accepted Solutions

@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

View solution in original post

5 REPLIES 5
Lubos KOUDELKA
ST Employee

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

@Lubos KOUDELKA​ thank you for the answer, I created the new project with same settings, except my MCU is STM32F407VE,

but it doesn't work, maybe you can find an error

Anton

Lubos KOUDELKA
ST Employee

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

@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

Nikolay Mernik
Associate

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