bug in lpc17xx hal nxpusblib

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bug in lpc17xx hal nxpusblib

494 Views
lpcware
NXP Employee
NXP Employee
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
Labels (1)
0 Kudos
1 Reply

378 Views
janblumenkamp
Contributor I

Discovered the same issue today. For me, it only works this way:

LPC_USB->USBClkCtrl = 0x1A;

while ((LPC_USB->USBClkSt & 0x12) != 0x12);

0 Kudos