USB user defined device support

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB user defined device support

2,965 次查看
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!!

标签 (1)
标记 (1)
0 项奖励
回复
4 回复数

1,393 次查看
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 项奖励
回复

1,393 次查看
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 项奖励
回复

1,393 次查看
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 项奖励
回复

1,393 次查看
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 项奖励
回复