cancel
Showing results for 
Search instead for 
Did you mean: 

USBD_Init Arguments

florianaugustin9
Associate II
Posted on December 14, 2012 at 21:39

Hello 🙂

I'm trying to programm a virtual com port with the stm32f4discovery.

In the official document of STM called ''STM32F105xx,... USB

On-The-Go host and device library'' there are the following arguments for USBD_Init listed:

void USBD_Init

(USB_OTG_CORE_HANDLE *pdev,

USB_OTG_CORE_ID_TypeDef coreID,

USBD_Class_cb_TypeDef *class_cb,

USBD_Usr_cb_TypeDef *usr_cb)

After searching the net for similar projects than mine i found a lot that are using this function with on parameter more (picked out of https://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/main.c?rev=5213):

USBD_Init(&USB_OTG_dev,     

USB_OTG_FS_CORE_ID, 

&USR_desc, 

&USBD_CDC_cb, 

&USR_cb);

I would be really glad if someone could explaint to me why it's like that!

Thank you a lot and have a nice weekend,

Florian

2 REPLIES 2
vikas_sinha75
Associate II
Posted on December 15, 2012 at 16:06

Hello,

this function USB init is responsible for entire USB initialization. Inside this function we pass various parameters that are related to USB core e.g. Devide address is by *pdev, core ID , callback function for this particular type of USB class *class_cb and user call back function pointers by *usr_cb.

As mentioned in the firmware that we are calling ''USBD_Init ()'' function and we are passing various parameters of USB device i.e. device address is '' USB_OTG_dev '', USB core ID is  '' USB_OTG_FS_CORE_ID '', USB call back functions parameters pointer is '' USBD_CDC_cb '' and User call back function parameters pointer is '' USR_cb ''.

If we check the details of  ''USBD_Init ()'' function we can find out more details of this function. Inside this function HW configuration,  USB core Initialization, and basic configurations are done.

For more details please search these parameters in Firmware you will find more details and initialization value of these parameters.

Please let me know if you have any further queries.

florianaugustin9
Associate II
Posted on December 16, 2012 at 22:27

Thank you a lot for the answer!

Is there anything like ''stm32f4xx_dsp_stdperiph_lib_um'' for the standard library where I can get information about the USB-library? Also I have problems to find out when which ISR (For example ''OTG_FS_WKUP_IRQHandler'' or ''OTG_FS_IRQHandler'') is called. For example I don't know why EXTI15_10_IRQ is connected to OTG_FS_WKUP_IRQHandler. where is this connection made? Is the only information source the examples? What exactly do you mean with firmware? The Libraries in the device lib?

Thanks again for your help and sorry for this great many of questions!!