USB host K64F  Please Help

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

USB host K64F  Please Help

1,140 Views
jeffking
Contributor II

I am so close to having this work for me.  I've been struggling with this, but I need some help please

 

I am using the Kinetis Design Studio (KDS) 2.0.0 w/ the Kinetis SDK 1.1.0.  I created a new project w/ the SDK and PE.

 

It seems there's some issues with the fsl_usb_framework (I'll writeup a document after this project is complete).  However, I am now connected to my USB HID Device which is a display unit.  I'm at the point where I need to send data and receive data.

 

There's no examples of this, the HOST example code only reference mouse/keyboard.  Neither of which send data to the device.  I am looking for some simple example of how to use "usb_host_send_data".  There's a tr_struct_t I have to fill out, but I'm not sure how to fill it out.

 

I'm coming from mbed, on mbed I was able to get the interrupt in/out endpoints and could send data fairly easily through that and listen for data in a thread.  I'm trying to do the same thing here, but am not sure how to set this up and there doesn't seem to be any examples out there or much documentation.

 

Is there any source showing a simple example using usb_host_send_data ?  If not, could someone explain the minimum requirements of that tr_struct_t ?  Do I need to fill out the usb_setup_t struct for example??  And where do I get and specify the endpoints, or do I need to?

 

I'm soo close, I could use a little push in the right direction

 

Thanks in advance!

Jeff King.

Labels (1)
Tags (3)
0 Kudos
3 Replies

609 Views
jeffking
Contributor II

Hi Guys,

I was able to figure out a solution to which I'll post a little later for anyone else having troubles.  However, I now cannot send multiple data streams.  Can someone please confirm my logic:

1. Open pipe for sending data

2. Get tr structure to pass along with sending data

3. Send my data to the USB device.

This works the first time, but the second time nothing happens.  Do I need to do all the steps again?  Does the pipe remain open?

Thanks

Jeff.

0 Kudos

609 Views
jeffmakes
Contributor II

Hey Jeff it would be great if you could post any details about your work getting fsl_usb_framework to function!

My thread here describes my situation Standalone bare metal USB MSD with K64F, KSDK-1.1.0 and KDS 2.0.0, SDHC and fatfs but I would appreciate any clues at all about how you got your USB interrupts firing, etc. Currently my init code seems to work fine, returning lots of USB_OK's but when you plug in a cable, nothing happens. I'm using the IRC48 clock init code from the example.

Cheers

Jeff

0 Kudos

609 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Jeff!

For example usb_host_send_data()  you can try in example cdc_serial, located at C:\Freescale\KSDK_1.1.0\usb\example\host\cdc\cdc_serial or C:\Freescale\KSDK_1.1.0\usb\example\host\cdc\cdc_serial\sdk\kds\host_cdc_serial_twrk64f120m_bm

The function usb_host_send_data() is used in usb_host_cdc_io.c, exactly

usb_1.png

usb_2.png

And follow these steps:

1. Run the host_cdc_serial example.

2. Plug-in the CDC device and you will see some attach information printed out.

3. Type some string and the string will be sent to CDC device if either of the following becomes TRUE:

  • Any “\r” or “\n” received.
  • The string length is greater than CDC_MAX_PKT_SIZE

After that CDC host will read back the string and put it to stdout.

I hope that helps you,

Best Regards,

Iva

0 Kudos