USB0 writeEP timing

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

USB0 writeEP timing

1,319 Views
adb
Contributor I

Hello,

I'm trying to download 16MB of data from a flash memory in packets of 512 bytes using the LPC4353. My code is based on HID generic. I'm able to reliably download most of my data, but occasionally I get the odd glitch.

At a low level, I use writeEP to write my packet of data to USB0. I've found that I need a delay between 0.5 and 1 ms between packets. I also wait for a flag which I set in the HID_Ep_Hdlr interrupt callback whenever a USB_EVT_IN event occurs. bInterval has been set to 1ms. I understand that the microcontroller can only send the next packet of data to the PC at the PC's request?

How can I send data as fast as possible without any data loss?

Thanks in advance for any comments,

Alan

Labels (5)
0 Kudos
7 Replies

933 Views
adb
Contributor I

Hi again,

Is it possible to detect if a packet has been acknowledged by the host?

Regards,

Alan

0 Kudos

933 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

First of all, sorry for the later reply.

If customer had downloaded and refer LPCOpen software for LPC4300 family product about USB bandwidth test demo?

The USB bandwidth test demo located at default project folder:

..\lpcopen_3_02_keil_iar_mcb4357\LPC43xx_18xx\prj_mcb4357\keil\usbd_rom_bwtest

This demo use USB bulk transfer mode with USB host acknowledge.

Wish it helps.


Have a great day,
Mike

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

0 Kudos

933 Views
adb
Contributor I

Hi Mike,

Thank you for your comments. This example uses WCID. Is it worthwhile modifying the example to work as HID (I've got a C# PC app that works with HID)?

Is there an app note on this code?

If I understand correctly: this program uses 4 endpoints as opposed to the 2 that were used in the generic HID example and implements a data transfer queue. How do I add data to the dataTosend queue? Are any PC app examples available?

Thanks in advance for your comments,

Regards,

Alan

0 Kudos

933 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Alan,

First of all, sorry for the later reply.

Unfortunately, there without related application note about USB device [bandwidth test] demo project.

There using four endpoints at [bwtest] demo.

If you check here you could found Keil provide USB Stack for MCB4300(LPC4357) board.

There with PC host HID application located at Keil installation folder <HIDClient.exe>.

The related source code also at that folder.

More detailed info, please check below picture:

pastedImage_1.png

Wish it helps.


Have a great day,
Mike

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

0 Kudos

933 Views
adb
Contributor I

Hi Mike,

Thank you for getting back to me on this. Can Keil's HIDClient,exe program communicate with a microcontroller that enumerates as WCID? I have my C# program that uses HID and it can't pick it up.

Regards,

Alan

0 Kudos

933 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Alan,

I find USB Band Width test and WCID examples for USB ROM API , which provides a [LPCUsbTest.exe] for PC host.

Please check if that program works or not.

Wish it helps.


Have a great day,
Mike

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

0 Kudos

933 Views
adb
Contributor I

Hi Mike,

Thanks for the link, I will take a look.

Regards,

Alan

From: Hui_Ma <admin@community.nxp.com>

To: Alan Ball <adball24@btinternet.com>

Sent: Monday, 11 June 2018, 8:49

Subject: Re: - Re: USB0 writeEP timing

#yiv7992375219 * #yiv7992375219 a #yiv7992375219 body {font-family:Helvetica, Arial, sans-serif;}#yiv7992375219 #yiv7992375219 h1, #yiv7992375219 h2, #yiv7992375219 h3, #yiv7992375219 h4, #yiv7992375219 h5, #yiv7992375219 h6, #yiv7992375219 p, #yiv7992375219 hr {}#yiv7992375219 .yiv7992375219button td {}

|

NXP Community

|

Re: USB0 writeEP timing

reply from Hui_Ma in LPC - View the full discussionHi Alan, I find USB Band Width test and WCID examples for USB ROM API , which provides a for PC host.Please check if that program works or not.Wish it helps.

Have a great day,

Mike 

0 Kudos