cancel
Showing results for 
Search instead for 
Did you mean: 

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

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​ 

5 REPLIES 5
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

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

Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
JP19
Associate

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.
Evangelist III

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

-- pa