Content originally posted in LPCWare by bthomas on Thu Jan 26 14:02:33 MST 2012
Hi,
Just a small bug report. I experienced today a microcontroller (LPC1764) blocking on HAL17XX_USBInit(). See the following lines:
LPC_USB->USBClkCtrl = 0x12; /* Dev, PortSel, AHB clock enable */
while ((LPC_USB->USBClkSt & 0x12) != 0x12);
Values 0x12 are 0x1A in the distribution. I changed them to 0x12 because bit 3 in both registers should not be written and may be unpredicatable when read. I had never seen this blocking behaviour before on other devices so my first intuition was that there must have been a hardware problem. However, investigating this further revealed this problem and changing it as described above solved the problem.
Hope this helps someone.
Regards,
Bert