lpcopen usblib rtos integration

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

lpcopen usblib rtos integration

943 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wella-tabor on Wed Jul 03 00:42:12 MST 2013

Hello,


I am using an RTOS with 1 ms tick rate (locked). Because "The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode.", it is almost impossible to get on timings. I am not sure if a creation of a task with low priority and for(;;) loop is a good solution. Is it possible to execute USB_USBTask() right after the SOF interrupt?


E.g.


<code>RTOS_USB_Task(){ for(;;){ wait_for_SOF_int(); USB_USBTask() } </code>


Best,


Martin


 


Usb configuration: host


Processor: LPC1788

Labels (1)
0 Kudos
Reply
2 Replies

913 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Mon Jul 15 23:36:17 MST 2013
Some old USB engines on LPC families have restriction of concurrent endpoint access.
Also, LPCUSBLib (modified LUFA) in LPCOpen is careless on the endpoint coding.

See this post on LPCXpresso forum for the details,
http://knowledgebase.nxp.com/showpost.php?p=29724&postcount=2

These problem on "shared resource" should make trouble on RTOS, when your code accesses to endpoints from two or more threads which run concurrently.

Tsuneo
0 Kudos
Reply

913 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wella-tabor on Fri Jul 05 04:55:17 MST 2013

Hello,


what about to write to the forum what steps should be performed to make the usblib more RTOS friendly?


Here is one of them:


- Replace the HcdDelayMS(uint32_t  delay), file HCD.c, by your RTOS function to wait n milliseconds.


In the course of time I'll add more and more.


Best


Martin

0 Kudos
Reply