I have been trying to fix an enumeration issue for a few days now...without any luck. I am using a MSP430F6638 Rev A MCU with MSP-TS430PZ100USB target board. My board came installed with a 4 Mhz crystal for XT2 (the case of the crystal reads FT4.000)...although I cant seem to see that frequency on the scope.
I downloaded the latest USB developer package and am trying to run both the CDC and HID examples included in the package. First, I try CDC mode...I follow the directions and make the descriptor files and the inf file using the tool making sure I input correct VID/PID values...I check the self powered button because I am powering the device from the JTAG connector and not USB and finally I input 25 Mhz for MCLK frequency and 4 Mhz for XT2 frequency. I then overwrite the descriptor files in the config folder of each example with the newly created ones. Before running the first CDC example, I make sure to change the CCS build to the write microprocessor. Then I build and run.
The first time I ran this, the program would just run without windows seeing a USB connection. So, I went into the code step by step and found out that the program was getting stuck in a while loop that tries to clear the OFIFG fault flags in the init_FLL function of the HAL_UCS.c file. When I watch the registers, I can see that apparently the XT1LFOFFG flag never goes 0...I suppose this flag is what keeps the program in that loop forever. But its strange because I have not XT1 crystal connected to the board and the USB module doesn't even need the XT1 crystal...and I can tell by UCSCTL6 that this program tries to drive both the XT2 and XT1 for some reason.
Anyway, so next, I just comment out the while loop that tries to clear these flags in the HAL_UCS.c file and then run the program. This time, the program execution makes it through to the USB initialization code. Now, I see windows pop up an unrecognized USB device prompt. I click update drivers and point it to the folder with the inf file. But strangely, windows seems to reject the driver...it doesn't install it and says that windows has determined there is already a better driver installed. I even tried to point it to the exact file but it says windows did not find a compatible driver and fails. So, enumeration fails and the program hangs on the USB_handleVbusOnEvent function.
I tried to verify that my XT2 crystal is working by running the MSP430F66xx_UCS_08.c file in the MSP430F6638 code examples. During step by step execution, I see the XT2OFFG flag go on during UCSCTL6 &= ~XT2OFF. But then there is a loop that tries to clear the OFFG flags...and this time the loop is successful...all flags are cleared and the program continues past the loop. So, I guess I can assume my XT2 crystal is working.
I have no idea why I cannot get the device to successfully enumerate. I even tried this with HID examples (with the proper procedure in using the descriptor tool to generate HID descriptors) but it still doesn't enumerate. Could someone please help me diagnose this problem? Its driving me insane! Thanks!