About the USB/CDC Freescale MQX code example. (Specifically what does calling USB_CDC_Periodic_Task() over and over do?)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

About the USB/CDC Freescale MQX code example. (Specifically what does calling USB_CDC_Periodic_Task() over and over do?)

565件の閲覧回数
rickstuart
Contributor V

Hi,

I am in the middle of adapting the USB/CDC Freescale MQX code example for my project. This example sets up a 2 way connection ...

(4.1.1 does have a bug in this Freescale example code which has been reported - see here for fix: (I have compiled and uploaded the Freescale 4.1.1 virtual_nic example - how do I verify it is working...))

...between the USB and Ethernet port.  In that code interrupts and call backs are setup to take care of USB communication.  Still, that code ends up in an infinite loop:

   while (TRUE)

   {

     /* call the periodic task function */

      USB_CDC_Periodic_Task();

   }/* Endwhile */ 

I have been told this fragment of code above was to make the overall Freescale USB/CDC example compatible with "bare metal" applications (i.e. w/o the MQX Operating System).  So I removed it from my project.  But my project, when connected to a Win7 box, always results in a "Disabled" network.  Rendering it useless.  Even to test applications like WireShark.

I searched for a detailed explanation of this function, but have only found this (MQX_USB_Device_Reference_Manual.pdf):

4.2.4  USB_CDC_Periodic_Task()

Complete any left over activity

during a specified time period.

Synopsis

void USB_Class_CDC_Periodic_Task(void);

Parameters

None

Description

The application calls this

API function to enable the driver to co

mplete any left over activity on the

device’s control endpoint.

Return Value

None


...so, what does "left over activity" mean?


-thanks

0 件の賞賛
1 返信

211件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi Rick,

Extracting the stack from MQX is not an easy task. If you want to use a bareboard USB stack (without Operating System) I strongly recommend USB Stack which you can download here: USB Stack|Freescale

Regarding USB_CDC_Periodic_Task, it is a function that is called to check the status flags set by the callbacks of the CDC state machine.

Regards,

Carlos

0 件の賞賛