USB user defined device support

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

USB user defined device support

2,115 Views
epl
Contributor I

I have built an application based on the device disk example.

 

I am able to have the device enumerate on a windows pc, and now I can call the devapi.h to receive and send the data. 

 

However, I faced a problem. That is, I don't know how to check when is the transfer finished??? 

 

Thanks in advance!!

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

543 Views
epl
Contributor I

Dear juroV,

 

Yes.

Now the M52259 can detect if the receive buffer empty. If no, it will return immediately as we expected.
The problem is, I want it the code to block until there is something in the receive buffer.
Is there any flag or criteria I can use for the blocking?

 

Thanks in advance!!

0 Kudos

543 Views
epl
Contributor I

Hmm, if I put a "getchar" to monitor the buffer, I can check if M52259 receive data. However, that's not an intuitive and convenient way. So I want to know if there is an existing mechanism such as checking a flag that can allow me to check the buffer asynchronously?

 

By the way, I have checked the USB device API reference. It talked about using _usb_device_get_transfer_status() to check if tranfer is over. However, I checked the value in my code, the flag value before and after transfer remained the same.

0 Kudos

543 Views
JuroV
NXP Employee
NXP Employee

Dear epl,

 

I still dont understand, you did not answer my question. I then repeat again:

Let me summarize: you want to build an application, which will behave as USB device with MQX. You started from MSD disk example in usb/device/examples. The common framework and MSD class handles the device enumeration correctly. Now you want to send data when asked from host- you send it but you dont have any feedback that data were sent. Am I correct?

0 Kudos

543 Views
JuroV
NXP Employee
NXP Employee

Hi epi.

Let me summarize: you want to build an application, which will behave as USB device with MQX. You started from MSD disk example in usb/device/examples. The common framework and MSD class handles the device enumeration correctly. Now you want to send data when asked from host- you send it but you dont have any feedback that data were sent. Am I correct?

0 Kudos