Skip to main content
CC_ROB
Associate II
May 3, 2019
Question

STM32F407VGTx / CDC / Error Driver

  • May 3, 2019
  • 20 replies
  • 10794 views

Hello,

I test the CDC with my STM32F407VgTx in an up-to-date environment:

 Windows 10 / STM32CubeMx v5.20 / SW4STM32 / System WorkBench for STM32/ST-LINK V2

The VCP v 1.50 driver for windows 10 has been installed normally and declared active.

The source of the CDC program used is:

\ STM32Cube_FW_F4_V1.24.0 \ STM32Cube_FW_F4_V1.24.0 \ Middleware \ ST \ STM32_USB_Device_Library \ Class \ CDC

When running the program, when init the USB, I get Windows Error 43.

 Unknown USB Device (descriptor request failure).

Can you help me solve this problem?

In advance thank you

Robert

This topic has been closed for replies.

20 replies

CC_ROB
CC_ROBAuthor
Associate II
May 8, 2019

HSI

Pavel A.
May 8, 2019

Yes so there's a problem with clocks. Need to have external oscillator for USB?

-- pa

CC_ROB
CC_ROBAuthor
Associate II
May 10, 2019

 Hello,

After trying the different proposals I am still stopped by the same problem .

 A priori the problem is not due to:

 - an overflow of the heap or the stack because the increase of their allocation did not solve anything

   It should be noted that my program is minimun and does not have recursive user functions

   which could cause the stack to overflow. Simply commissioning test of the CDC and the management of an LED

   

   Note that the USB Tx and USB Rx buffers of 2048 octes each are not on the stack and the flash is far from saturated.

  

  -a HARDWARE problem because I was able to load and execute normally other Hex files using USB .

  

 Moreover, the version 2.13 retrogression did not solve my problem .

  

 Other investigations:

 Being an amateur model airplane I tried to load a program of the application CLEANFLIGHT using a STM32F4

 This is OMNIBUSF4.HEX

 Loading in my map was done normally as expected with the DFU BOOT0> BOOTLOADER32 procedure

 Once loaded this program could normally use the STMicro VCP COM9 virtual port without any abnormality appearing in the device manager.

 (CLI online order via the VCP)

 I then loaded / executed my program AC6_DIYMORE_CDC.hex thanks to the same procedure.

 At the execution the initial anomaly appeared again and the COM9 STMicro VCP port disappeared in the device manager

 I conclude that the problem is probably due to an anomaly in the USB / CDC libraries provided by ST Micro or in the code generated by STM32CubeMX.

  

 I enclose the VCP files used by CLEANFLIGHT available on Github. Maybe they will be useful for debugging ....

CC_ROB
CC_ROBAuthor
Associate II
May 10, 2019

VCP CLEANFLIGT

CDC OK

Pavel A.
May 10, 2019

The picture you've posted 2 days ago shows a problem with USB clock. Have you resolved it? Does the board have external oscillator for HSE?

-- pa

CC_ROB
CC_ROBAuthor
Associate II
May 10, 2019

Hello,

Sorry to have mixed HSE / HSI in the text 2 days ago.

My card has an external crystal of 26 Mhz / HSE

I'm doing my tests in this extern crystal config

I had been told that the CDC was working in 16 Mhz / HSI but when I saw that there were clock config problems I did not try.

That said if there was a solution to work with the USB without extern crystal outside I would be a taker.

Rob

CC_ROB
CC_ROBAuthor
Associate II
May 10, 2019

Hello,

Addition LED2 control by PE0

Libs version 1.24.1

New ioc file attached.

Pavel A.
May 11, 2019

>  if there was a solution to work with the USB without extern crystal outside I would be a taker.

Some MCUs with device-only controller (F072 for example) can derive the USB clock from host, using SOF.

They can work without external crystal. I don't know whether OTG can do this, even in device mode.

-- pa

Harry McKee
Associate II
May 14, 2019

I think I'm having the same problem (but with an L4 and F7 board). I've got debug output on another thread: https://community.st.com/s/question/0D50X0000Ap1YIzSQM/do-the-virtual-com-port-drivers-work-with-windows-7

Please take a look and see if this is similar to your issue.

When I run it on a Windows 7 system, I get the USB error 10. Window Server 2012 systems shows USB error 43.

The issue I'm seeing has been fixed. It was an unaligned memory access in USB_WritePacket.

CC_ROB
CC_ROBAuthor
Associate II
May 15, 2019

Hello,

Thank you for your information.

My error code is different from yours : 43 in Windows 7 and 10 .

I still modified USB_Write Packet (...) but the problem has not been solved.

CC_ROB
CC_ROBAuthor
Associate II
May 29, 2019

Hello,

Same problem with last version (5.2.1) of STM32CubeMX.

Sorry.

Robert.