USB Host Rec Data Callback

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

USB Host Rec Data Callback

625 Views
jeffking
Contributor II

Hello,

 

I'm using the K64F platform with KDS 2.0 w/ KSDK 1.1 along with the component fsl_usb_framework.

 

Does anyone know why my usb_host_recv_data() callback that I pass in only gets hit sometimes?  And only the first call I make to it?

 

Here's a snippet (for clarity sake, I removed my error handling):

 

// open my pipe (INTERRUPT PIPE RECV)

usb_host_open_pipe(usbFmw1_Handler, &pipeIn, &pipe_init)

 

// get tr structure and pass in my callback (which gets setup in my tr structure)

tr_struct_t* tr_ptr2;

usb_host_get_tr(usbFmw1_Handler, read_done, NULL, &tr_ptr2)

 

// setup my receive buffer and size

tr_ptr2->rx_buffer = readbuf;

tr_ptr2->rx_length = 1024;

 

// call recv

usb_host_recv_data(usbFmw1_Handler, pipeIn, tr_ptr2

 

typically if I have a breakpoint set at usb_host_recv_data; my callback for read_done will be called with a status of 0x0.  All good.  If I don't have a breakpoint, my callback never gets hit.  If I try and call these functions again after the callback then I never get a second hit into read_done callback.

 

Any idea why my callback is sometimes working the first time around and never called the second time?

 

I'm thinking I have to loop constantly waiting for data (I have a USB device with buttons).  It'd be great if it was a blocking call and just sat till data came across the line.

 

Thanks,

Jeff.

Labels (1)
0 Kudos
1 Reply

485 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Jeff,

I just saw your another thread of USB host K64F Please Help which had some suggestion from ivadorazinova , so how is the issue now? is the problem still there? Please kindly help to clarify. Thanks for your patience!


Have a great day,
Kan

0 Kudos