AnsweredAssumed Answered

Issue with USB library on discovery f4 board

Question asked by anton.bogdan on Jul 6, 2014
Latest reply on Jul 7, 2014 by anton.bogdan
Hi guys, i`ve spent several hours trying to figure whats wrong in my initialization routine, but no luck at all...
Here is my code
#include "system_stm32f4xx.c"
 
#include "stm32f4xx.h"
#include "usbd_cdc_core.h"
#include "usbd_cdc.h"
#include "usbd_usr.h"
#include "usbd_desc.h"
 
 
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
  #if defined ( __ICCARM__ ) /*!< IAR Compiler */
    #pragma data_alignment = 4  
  #endif
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
__ALIGN_BEGIN USB_OTG_CORE_HANDLE  USB_OTG_dev __ALIGN_END;
 
void main() {
SystemInit();
 
  USBD_Init(&USB_OTG_dev,
            USB_OTG_FS_CORE_ID,
            &USR_desc,
            &USBD_CDC_cb,
            &USR_cb);
  
}
Beside the files included in the project above there is nothing else included, only what you see.
My problem is that the complier reports me with errors saying :
Building configuration: imu - Debug
Updating build tree...
main.cpp  
Linking
Error[Li005]: no definition for "USBD_Init" [referenced from C:\Users\Bogdan\Desktop\discovery F4\IMU Project\Debug\Obj\main.o]
Error[Li005]: no definition for "USR_desc" [referenced from C:\Users\Bogdan\Desktop\discovery F4\IMU Project\Debug\Obj\main.o]
Error[Li005]: no definition for "USBD_CDC_cb" [referenced from C:\Users\Bogdan\Desktop\discovery F4\IMU Project\Debug\Obj\main.o]
Error[Li005]: no definition for "USR_cb" [referenced from C:\Users\Bogdan\Desktop\discovery F4\IMU Project\Debug\Obj\main.o]
Error while running Linker
Total number of errors: 4
Total number of warnings: 0

My question is where are these variabile defined? i tryied several projects from internet, and on all variants  i get to this point.
Why is it saying that are not defined?
When i try to complie the code, it complies, but when i try to build/burn to the board it reports me thouse errors.
This is my first time i try to play with usb libs...
thanks

Outcomes