LPC18xx USB CDC Demo causes hard fault

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

LPC18xx USB CDC Demo causes hard fault

1,662 Views
yuanbinzhou
Contributor II

Hi all,

We are currently evaluating USB CDC function on LPC1837 NGX evaluation board and using demo downloaded from LPCOpen Software for LPC18XX|NXP .  The cdc_uart project has been successfully compiled in my computer and can be downloaded into the target with JTAG . However that demo cannot run successfully in my evaluation board since I cannot find any USB-to-UART device in my computer. When I use JLink to debug the code, I found that "USBD_API->cdc->init" in vcom_init always cause the hard fault. Notice that "init" function will call rom usb driver, so it seems that this problem is related to boot room driver? Any ideas on how to solve those kinds of problem? The value of registers when chip enter into the hard fault are listed below:

pastedImage_1.png

Labels (1)
0 Kudos
10 Replies

1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yuanbin,

   Please use the attached LPCXpresso IDE lpcopen project.

   This project don't have the problem.

   pastedImage_1.png

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,277 Views
yuanbinzhou
Contributor II

Dear kerryzhou

Thanks for your reply. This question has been dealt  and it seems that it is a bug under the IAR Platform. That causes by the simultaneous usage of USB and DMA in AHB SRAM region. When I altered usb_param.mem_base=0x20000000 to usb_param.mem_base=0x20008000, all problems have been solved. By the way, any tools to test the usb speed between computer and evaluation board?

0 Kudos

1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yuanbin,

   About the IAR project problem, I have report it to the according department.

  About the usb speed test, you need to find a specific USB test tool to test it. You can google it.

   This link is from the google, you can refer to it:

5 Apps to Check the Speed of Your USB Flash Drive (Windows) 

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,277 Views
yuanbinzhou
Contributor II

Dear Kerry,

That tool cannot satisfy my requirements since it is used to test the speed of USB Flash driver. What I need to do is to test the speed over the USB-TO-UART interface which has distinct difference with the former one. Thanks anyway for your help.

0 Kudos

1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yuanbin,

    I will help you to check it with other colleagues whether there has any good tool to test it in the next week.

Best Regards,


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,277 Views
yuanbinzhou
Contributor II

Hi Kerry,

Thanks for your reply. Any tools wrapped by libusb to test usb speed is available?

0 Kudos

1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Yuanbin,

    Maybe you can use the USB analyzer(external hardware tool) to test the whole USB communication data and the time.

    We just have this recommendation.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,276 Views
yuanbinzhou
Contributor II

Hi Kerry,

Thanks very much for your help. Currently I find an example related to libusb under directory "lpcopen_3_01_keil_iar_nxp_lpcxpresso_1837\LPC43xx_18xx\prj_xpresso1837\iar\usbd_rom_libusbdev". However there only exists files extended with "dep" and "ewp", I did not know how to compile it. Could you please help me?

One more question is on how to change the usb mode to high speed mode. I used USB0 with support of high speed mode and commented code "desc.full_speed_desc = USB_FsConfigDescriptor;" under cdc_vcom project, however nothing changed. I have read the manual table 501 and it seems that if the full_speed_desc is different from the item  high_speed_desc, the usb will be set to the high speed mode. It is really strange. Any hints on that?

0 Kudos

1,277 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yuanbin,

    1. usbd_rom_libusbdev build

 Please refer to the following picture.

pastedImage_1.png

2. USB high speed configuration.

  Normally, for the new question, you need to create the new post, please don't answer more questions in one topic, the topic question already solved.

  So, if you want to know the USB high speed configuration, please create the new post, we will help you in your new post.

  One post for one question topic.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,277 Views
yuanbinzhou
Contributor II

Sure. I will post a new thread.

0 Kudos