USB Mode selection ??

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Mode selection ??

468 Views
karthikas
Contributor IV

 I am working with MK66FN2M0VLQ18 MCU and KEIL platform (keil5). 

 

I want to establish communication between Application running on PC and MCU through USB(USB-High Speed), MCU should be in Device mode. I intend to send the received data from PC(through USB) through flex bus. 

 

I have SDK2.0 stack , How can I use this stack in our application, In USB device mode there are so many classes (CDC,HID,MSC,MSC ram disk, etc classes). Which class would you prefer.

 

Also help me how to start with this stack.  

Labels (1)
0 Kudos
13 Replies

112 Views
karthikas
Contributor IV

Can anyone help me by giving reply as earliest please , 

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Karthik,

This is my opinion, if the data you want to transfer is stream, for example, you have to transfer fixed size of datas in one second, you can use the audio class application. If you want to transfer a bundle of datas without time requirement, I think you can use CDC classs.

Hope it can help you.

BR

XiangJun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Hai xiangjun.rong .,

Thank you for your reply.

Once I will clear my side requirement , I have an application in PC through which I want to transfer data to USB device(i,e I need to operate USB device through PC).

As your suggestions I have seen documents related to audio classes which is provided with SDK 2.0, But I don't think this class is suitable for my application .

If I choose CDC mode , In stack they have provided CDC_VCOM mode i,e USB device will enumerate as virtual COM port , I want to know that is it possible to meet above requirement in CDC class mode.

I am thinking to choose usb_device_hid_generic mode ,In this mode they have provided one application through which we can send/receive data b/w PC and USB device.

Whats your suggestions ..? 

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Karthik,

As far as I know that the audio class uses Isochronous transfer, CDC class uses bulk transfer, HID uses interrupt transfer. The HID class is suitable for the mouse, keyboard, joystick, slider, knob, throttle, bar-code reader...

Hope it can help you.

BR

Xiangjun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Haixiangjun.rong .,

Okay i will use CDC class , but in stack they are not provided any drivers to enumerate as CDC device , The stack has drivers to enumerate the device as Virtual COM port (usb_device_cdc_vcom), But I need to enumerate as USB device mode not as virtual COM port. 

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The "Virtual COM port" means you simulate the USB port as a UART, I think you can use CDC to transfer your datas.

Hope it can help you.

BR

XiangJun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Haixiangjun.rong .,

Can you please provide the link to get stack related to USB CDC class , I have one stack SDK 2.0 but it was bit difficult . 

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Karthik,

I think you can refer to the directory after you download SDK2.0:

C:\Freescale\SDK2.0_K64F\boards\frdmk64f\usb_examples\usb_device_cdc_vcom\freertos

I have not the  other example.

BR

XiangJun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Haixiangjun.rong .,

I can enumerate the device as Virtual COM port by using the code you referred , But my requirement is to enumerate device as USB Composite device . As virtual COM port host side application is not supporting. 

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

A composite USB device combines two class, which class do you want to combine with Virtual COM class? We have doc which describe how to combine two class.

pls refer to the user guide <<USB Stack Composite Device User's Guide.pdf>>" located at:

C:\Freescale\SDK2.0_K64F\docs\usb

Hope it can help you.

BR

Xiangjun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Hai  xiangjun.rong

I am working with MK66FN2M0VLQ18 MCU in our customized board.for the USB device mode.(USB High speed mode).

 

I have downloaded SDK_2.0_MK66FN2M0xxx18 , and running USB_DEVICE_CDC_VCOM .

It was running upto APPTASK() without any problem , but It has stopped in APPTASK(), and device is not getting detected in PC. 

 

Can anyone help me in resolving the issue as soon as possible.

 

Thank you.

0 Kudos

112 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

do you connect the USB module of K66 to the USB port? pls refer to the readme.pdf in the USB_DEVICE_CDC_VCOM for the hardware connection.

BR

Xiangjun Rong

0 Kudos

112 Views
karthikas
Contributor IV

Hai xiangjun.rong.,

Yes I have connected .

I am using USB1 , 

       USB1_DM --> D-

       USB1_DP --> D+

I am not using VBUS pin instead i am using on board voltage source.

I am attaching screenshots of USB part cir cute  for your reference. Can you please cross check once.USB_SCH.pngusb_sch1.png 

0 Kudos