I've been trying to get USB Host Functionality for the Tiva C LaunchPad Board to function while running under RTOS, but have been having some trouble. I have code that works fine when running outside of RTOS, but cannot enumerate the USB device when running inside of RTOS.
By default the Tiva C LaunchPad board has the following code in the EK_TM4C123GXL . Which basically states that USB Host not supported. Which is not the case for this board or the MCU, so I have been trying to add the support.
/* * ======== EK_TM4C123GXL_initUSB ======== * This function just turns on the USB */ Void EK_TM4C123GXL_initUSB(EK_TM4C123GXL_USBMode usbMode) { /* Enable the USB peripheral and PLL */ SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); SysCtlUSBPLLEnable(); /* Setup pins for USB operation */ GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_4 | GPIO_PIN_5); if (usbMode == EK_TM4C123GXL_USBHOST) { System_abort("USB host not supported\n"); } }
I have changed the code to the following to try and provide USB Host Support.
/* * ======== EK_TM4C123GXL_initUSB ======== * This function just turns on the USB */ Void EK_TM4C123GXL_initUSB(EK_TM4C123GXL_USBMode usbMode) { /* Enable the USB peripheral and PLL */ SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); SysCtlUSBPLLEnable(); /* Setup pins for USB operation */ GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_4 | GPIO_PIN_5); if (usbMode == EK_TM4C123GXL_USBHOST) { GPIOPinConfigure(GPIO_PC7_USB0PFLT); GPIOPinConfigure(GPIO_PC6_USB0EPEN); GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); // ID+VBUS } }
Are my settings correct?
The USB Host Driver I am using is one I developed for a CDC ACM device, which functions outside of RTOS. Are there any RTOS specific USB Host considerations I need to take into account?
Alternatively can someone please verify that RTOS does not support USB host for the board I am using?
Thanks,
Glenn.