I have a USB OTG application running on the EKS-LMF232 evaluation kit which either acts as a COM port pass-through to UART0 when in device mode or collects data through UART0 and saves the data to a flash drive.
What I want to do is port the code to a LM4F230H5QR on a custom board. I would like to know if what I have changed are the only changes required because right now it is not working completely.
What does work is that the device shows up as a COM port on the PC and I can connect to it with Putty. I send a character through the USB and it gets through the USB RX handler but does not return a character when it hits USBBufferRead() so the pass-through does not work. I did not try the Host feature yet.
To port the code, I first had to change the crystal setting from 16MHz to 8MHz to match the crystal I have on board. Is this crystal selection a problem for USB? It seems to work as it is recognized by the PC.
From this:
ROM_SysCtlClockSet (SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
To this:
ROM_SysCtlClockSet (SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_8MHZ | SYSCTL_OSC_MAIN);
Then I changed the USB port definitions from this:
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOB);
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOG);
ROM_GPIOPinConfigure (GPIO_PG4_USB0EPEN);
ROM_GPIOPinTypeUSBDigital (GPIO_PORTG_BASE, GPIO_PIN_4);
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOL);
ROM_GPIOPinTypeUSBAnalog (GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
ROM_GPIOPinTypeUSBAnalog (GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
to this:
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOB);
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOD);
ROM_GPIOPinConfigure (GPIO_PD2_USB0EPEN);
ROM_GPIOPinTypeUSBDigital (GPIO_PORTD_BASE, GPIO_PIN_2);
ROM_GPIOPinTypeUSBAnalog (GPIO_PORTD_BASE, GPIO_PIN_4 | GPIO_PIN_5);
ROM_GPIOPinTypeUSBAnalog (GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
I changed the device variant in the general project settings and changed the pre-defined symbols from PART_LM4F232H5QD to PART_LM4F230H5QR. I have kept the TARGET_IS_BLIZZARD_RA1 but I have also tried TARGET_IS_BLIZZARD_RA2 with no success.
I'm hoping someone out there can provide some insight with what little information I have provided. I believe the hardware is connected properly. It seems to be a software problem but anything is possible at this point. I have tried other ported USB and UART examples with success but I cannot figure out why this working example on the F232 cannot be ported to the F230. Any help would be appreciated.