Skip to main content
Dave Nadler
Senior III
June 2, 2019
Question

Bug: CubeMX-generated code for USB CDC fails to compile

  • June 2, 2019
  • 5 replies
  • 2719 views

Generated code for F429 Nucleo with USB CDC fails to compile Src\freertos.c etc. with messages:

..\Src\usb_device.c:55:22: fatal error: usbd_cdc.h: No such file or directory
 
..\Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Src\usbd_cdc.c:62:22: fatal error: usbd_cdc.h: No such file or directory
 
In file included from ..\Src\usb_device.c:56:0:
../Inc/usbd_cdc_if.h:59:22: fatal error: usbd_cdc.h: No such file or directory

I've attached IOC for easy reproduction of bug.

Thanks for any help or bugfix,

Best Regards, Dave

PS: Attention @Markus GIRDLAND​ @Imen DAHMEN​ 

This topic has been closed for replies.

5 replies

ST Technical Moderator
June 3, 2019

Hello @Dave Nadler​ ,

Probably, the Include Paths is not set up properly or you are missing an include file

Go to Project options and add new paths to your include directories

Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Dave Nadler
Senior III
June 3, 2019

Thanks @Imen DAHMEN​ - Path Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc was missing.

Please confirm you've reproduced this bug, and this bug is in your queue to fix,

Best Regards, Dave

ST Technical Moderator
June 17, 2019

Hi @Dave Nadler​ ,

This issue is confirmed and will be fixed in the coming release of STM32CubeMX.

Thank you for highlighting this.

Best Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
JP19
Visitor II
July 30, 2020

V6.0 Cube MX and STM32Cube IDE V1.40 still has this problem.

After adding Path Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc.

I still get errors "No such file or directory"

../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c:21:10: fatal error: usbd_core.h: No such file or directory

../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c:21:10: fatal error: usbd_ctlreq.h: No such file or directory

../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c:21:10: fatal error: usbd_ioreq.h: No such file or directory

../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c:21:10: fatal error: usbd_core.h: No such file or directory

Pavel A.
July 30, 2020

@JP19​ These files are in STM32_USB_Device_Library/Core/Inc/

-- pa