Configuration of the USB Host Core in µVision.
Configuration of the USB Host Core in µVision.
The configuration file USBH_Config_n.c contains generic settings for the USB Host. Support for certain USB Classes is configured in the respective device class configuration files (USBH_Config_CDC.h, USBH_Config_CustomClass.h, USBH_Config_HID.h and USBH_Config_MSC.h).
USB Host Configuration File
The USB Host configuration file USBH_Config_n.c contains the following settings:
- Connect to hardware via Driver_USBH# specifies the hardware driver number to use in case the microcontroller device contains more than one USB Host interface. Default value of 0 is used for devices with a single interface.
- Controller Interface selects the USB Host Controller Interface to be used. Refer to the technical reference manual (TRM) of the microcontroller device for the correct option to be used.
- For all Host Controller Interfaces you need to specify the Maximum Port Power Consumption, Maximum Pipes and the Memory Pool Size used by the USB Host Controller. These values should be taken from the TRM. Also, specify the Memory Pool Address if the memory pool needs to be relocated.
- For OHCI and EHCI you need to specify the memory-mapped host controller registers base address.
- OS Resources Settings are used to optimize usage of OS resources.
- The default Core Thread Stack Size is 1024 bytes.
- The default Core Thread priority is osPriorityAboveNormal. This priority can be changed by changing USBHn_CORE_THREAD_PRIORITY define in this configuration file. This priority needs to be high enough so that USB Stack can react to USB events in a timely manner. Due to this requirement it is recommended to keep this setting at default.