2020-01-28 06:15 AM
Hi all,
I am trying the example of USB CDC in:
https://www.youtube.com/watch?v=rLnQ3W8gmjY&list=PLnMKNibPkDnEEvQWrDqVuu1w_iQ214GXi&index=35
It uses the above functions.
But when I compile, I get :
undefined reference to `USBD_CDC_SetTXBuffer' and to USBD_CDC_Transmit_Packet
Can someone help ?
Thanks
Eli
Solved! Go to Solution.
2020-01-28 08:18 AM
Is this a COMPILE error, or a LINKER error?
Didn't look at the video, but presuming you started with CubeMX (or the IDE embedded version of this), those functions usually reside in usbd_cdc.h and usbd_cdc.c, located in
YOUR_PROJECT_DIR\Middlewares\ST\STM32_USB_Device_Library\CDC\Inc and \Src
If those files exist in your project directory, perhaps the IDE is not configured to look in those directories for files. Presuming you are using an Eclipse-based IDE, rIght-click on the project in the "Project Explorer" window, expand "C/C++ Build" and click on "Settings". In the "Tool Settings" tab, click on "Includes" under "MCU GCC Compiler". You should see a list of directories that the compiler searches for .h files. Make sure the above directory is listed.
2020-01-28 08:18 AM
Is this a COMPILE error, or a LINKER error?
Didn't look at the video, but presuming you started with CubeMX (or the IDE embedded version of this), those functions usually reside in usbd_cdc.h and usbd_cdc.c, located in
YOUR_PROJECT_DIR\Middlewares\ST\STM32_USB_Device_Library\CDC\Inc and \Src
If those files exist in your project directory, perhaps the IDE is not configured to look in those directories for files. Presuming you are using an Eclipse-based IDE, rIght-click on the project in the "Project Explorer" window, expand "C/C++ Build" and click on "Settings". In the "Tool Settings" tab, click on "Includes" under "MCU GCC Compiler". You should see a list of directories that the compiler searches for .h files. Make sure the above directory is listed.
2020-01-28 10:33 PM
Hi and thanks for the reply
It is a compile error
And I am working with STM CUBE
Eli
2020-01-29 05:56 AM
found the problem. Thanks
The compiler did not include the USB include file for some reason, although it is in the tree
I included it manually, and works fne
Thanks again
Eli
2020-04-11 07:52 PM
Eli,
How did you include it manually?
I'm having the same issue.
please provide more details.
thanks in advance
2020-04-11 07:52 PM
Eli,
How did you include it manually?
I'm having the same issue.
please provide more details.
thanks in advance