LPC15xx - USB ROM Api bug

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

LPC15xx - USB ROM Api bug

5,352 Views
corentin
Contributor I

Hi,

We have a problem with the USB ROM API for LPC15xx. We use a specific USB Class Device with 3 Bulk Endpoints + Vendor Request endpoint.

After few times, one of this endpoint stop it:

- Handler that correspond don't call

- USB Irq is not call

- Others Endpoints working well

This bug appear between 5 000 000 and 10 000 000 of packets sending (Write Bulk Transfer) by PC. USB context (struct _USB_CORE_CTRL_T*) sound coherent and all register in USB peripherals seem consistent. Find in attach captures of this data.

Someone have detected a similar bug? We haven't any Idea...

Thanks for your replies

Best Regards

Corentin

Labels (2)
Tags (3)
0 Kudos
Reply
9 Replies

5,151 Views
FelipeGarcia
NXP Employee
NXP Employee

Hello Corentin,

 

I am sorry for the late reply, we have been under a big workload.

 

Could you please explain more about the intention of disabling interrupts? Maybe you can try to disable or reset USB before you disable global interrupts.

 

Best regards,

Felipe

0 Kudos
Reply

5,152 Views
corentin
Contributor I

Hi,

Thanks for your reply.

This is just an example to reproduce the bug. Interrupts are disabling by another part of code in our project. We don't really understand why USB Interrupts is not stacked on all Endpoints during a Disable IRQ.

Do you have somes informations about this?

Regards

Corentin

0 Kudos
Reply

5,152 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Corentin,

 

I tried to replicate this issue on my side by modifying usbd_rom_hid_generic example the same way you mentioned. Unfortunately, I was not able to replicate this issue. I disabled the interrupts by pressing SW1 and after that, USB_IRQ was still called. The HID reports sent/received by this example are supported by HID_client.exe program distributed as part of Keil installation "(C:\Keil\ARM\Utilities\HID_Client)".

 

Please check the code attached.

 

Best regards,

Felipe

0 Kudos
Reply

5,152 Views
corentin
Contributor I

Hi Felipe,

Thanks for your reply.

In Fact, this code works perfectly, but you use only Endpoint 1.

Our problem appear when we use 2 endpoint (EP0, EP1_IN, EP1_OUT, EP2_IN, EP2_OUT). Do you have some informations for this bug when we use multiple EP?

Regards

Corentin

0 Kudos
Reply

4,974 Views
rydertacongmanh
Contributor II

Hi Corentin, 

I hope you are well !!!

Could you please share the status of your issue which happens when multiples EP were using? I am also in this problem and seemly you are right that the IRQ never been stacked when the IRQ handler is doing.

Really appreciate your input.

Thank you very much,

Best regards,

Ryder

0 Kudos
Reply

5,152 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Corentin,

 

I am sorry but I do not have information with multiple endpoint. Could you please try disable endpoint when interrupts are disabled and to reset endpoint after enabling interrupts again?

 

Best regards,

Felipe

0 Kudos
Reply

4,989 Views
rydertacongmanh
Contributor II

Hi Felipe,

We are in a similar issue now.  We intend to implement as your suggestion. We will update the result when we finish the testing.

"Could you please try disable endpoint when interrupts are disabled and to reset endpoint after enabling interrupts again?"

In this moment, may I know what might be different in this case if we do as two ways as below:

1. Using reset endpoint

+ Enter IRQ handler.

+ Disable endpoint.

+ Reset endpoint.

+ Exit IRQ hander.

2. Using enable endpoint

+ Enter IRQ handler.

+ Disable endpoint.

+ Enable endpoint.

+ Exit IRQ hander.

 

Thank you very much 

Best regards,

Ryder

 

0 Kudos
Reply

4,846 Views
rydertacongmanh
Contributor II

Hi all,

 

We solved this issue. Please pay attention with the configuration USB single buffer and USB double buffer. In our case, after changing to USB single buffer then the problem went away.

ps: we used NVIC_Disable for USB IRQ to "sync" between sending/receiving in EPs(working well).

Hope it help!

Thanks

Best regards,

Ryder

0 Kudos
Reply

5,152 Views
corentin
Contributor I

Hi,

We continuous investigation, and we wrote and very minimal program based on HID LpcOpen example, that you can find in attach (develop for OM13056).

We reproduce very simply bug when we push on SW1, that disabled IRQ temporary. Sometime, the Handler 2 is not triggered after enable_IRQ, and the pipe is blocked.

I attached also a demo program for QT MacOs that send in continuous bulk on both endpoints.

Do you have some information about this?

Best Regards,

Corentin

0 Kudos
Reply