I have a board with the LPC11U24 chip which I am trying to use the USB rom CDC example (nxp_lpcxpresso_11u14_usbd_lib_cdc).
I get a hard fault when calling the USBD_API->hw->Init().
I used the lpcopen_v2_00a_lpcxpresso_nxp_lpcxpresso_11u14 version just changing the chip to LPC11U24 as suggested in the forum.
I also used other LPC OPEN versions with the same results. The board has a 12MHz crystal like the example code.
How can I find the problem?
Is there non rom USB code available that also can work?
Is there any other LPC11U24 initialization that need to be changed or added to the LPCU14 ?
Thanks
Why we can not find the implement of "USBD_API->hw->Init"? Dose it is NXP's private library function?
You can't see source code of this function. This is USB ROM API.
For detail, see description of USBD_HW_API in UM, Chapter 10: LPC11U3x/2x/1x USB on-chip drivers
Best Regards
Jun Zhang
I will forward this to our hardware engineer and get back to you.
Thanks David
Hi
Do you use NXP LPC11U24 demo board test ?
LPC11U24 just has larger SRAM than LPC11U14, and has eeprom. All other peripherals are the same, so the driver lib is the same. LPC11U24 is backward-compatible with LPC11U14.
So you can use LPC11U14 LPCOpen code for LPC11U24.
Have a nice day,
Jun Zhang
This is good to know. This is a small LPC11U24 based custom board.
I used the USB CDC example as is which looks good but it gives a hard fault upon USB ROM initialization.
/* USB Initialization */
ret = USBD_API->hw->Init(&g_hUsb, &desc, &usb_param);
I do not have much to go on.
What could be the prblem or ways to find out what the problem is?
Thanks David
You can't see source code of this function. This is USB ROM API.
For detail, see description of USBD_HW_API in UM, Chapter 10: LPC11U3x/2x/1x USB on-chip drivers
Best Regards
Jun Zhang
Hi Jennie ,
Do you have LPC1830 UM ? Some reason, I can not scan the internet but only here I can.
If you have this UM please send it me.
Appreciate to you .
this is the UM link
I have verified USBD_API->hw->Init hard fault on my LPC11u24 demo board. it works. Is there any error code returned?
If you didn't change code, the problem may on your board. please check your USB hw design and clock setting. you need to use a USB monitor to check if the command is successful sent and if any response is received for MCU side.