cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC USBD_CDC_SetTXBuffer and USBD_CDC_Transmit_Packet

ECrom.1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

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.

View solution in original post

5 REPLIES 5
Bob S
Principal

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.

ECrom.1
Associate III

Hi and thanks for the reply

It is a compile error

And I am working with STM CUBE

Eli

ECrom.1
Associate III

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

ARodr.2
Associate

Eli,

How did you include it manually?

I'm having the same issue.

please provide more details.

thanks in advance

Eli,

How did you include it manually?

I'm having the same issue.

please provide more details.

thanks in advance