This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with usb device custom class middelware

hi to all,
i am emulating a usb floppy, and i decide to use keil usb middleware with custom class(usb floppies most implement ufi class and it dose not implemented by keil) to done this project, but i have a problem with that.
in some place host driver decide to reset bulk in and out pipes, and as result it will reset host data toggle to DATA0 without sending any CLEAR_FEATURE to reset device data toggle.
below table is part of usb communication dump of my device:

device-endpoint   phase   data                                           desc
12.0               ctl    21 00 00 00  00 00 0c 00                       control-setup
12.0               out    23 00 00 00  00 00 00 00  fc 00 00 00          control-data
12.2               in     00 00 00 08  00 00 0b 40  03 00 02 00          bulk-in
12.1               in     00 00                                          interrupt-in
12.0               ctl    21 00 00 00  00 00 0c 00                       control-setup
12.0               out    00 00 00 00  00 00 00 00  00 00 00 00          control-data
12.1               in     3a 00                                          interrupt-in
12.2               reset                                                 reset bulk pipe
12.2               reset                                                 reset bulk pipe
12.0               ctl    21 00 00 00  00 00 0c 00                       control-setup
12.0               out    03 00 00 00  12 00 00 00  00 00 00 00          control-data
12                 SSTS                                                  timeout
12                 SSTS                                                  request flushed
12                 reset                                                 bus reset
12                 ok


as you can see every thing is ok until host decide to reset bulk pipes and as result it reset host toggle but device toggle is DATA1 and as result next data transfer in bulk in endpoint will timeout and then host reset usb pipe and this is my problem.
i know that this is mistake by host, but i know where host reset pipe and now i am searching for a way to reset data toggle of my device bulk endpoints.
i did not find any function or utility in keil usb middelware api to reset data toggle.
now any one know any way to done that???

Parents
  • You are right there is no way to reset the endpoint data toggle from user API.

    There are 2 suggestions:
    1. you should investigate why host resets the bulk endpoints as that usually means host has detected that something is not right, or is is not getting expected responses, so by addressing the problem you should prevent host from resetting the bulk endpoints
    2. Write directly to your microcontroller's USB controller and reset data toggles

Reply
  • You are right there is no way to reset the endpoint data toggle from user API.

    There are 2 suggestions:
    1. you should investigate why host resets the bulk endpoints as that usually means host has detected that something is not right, or is is not getting expected responses, so by addressing the problem you should prevent host from resetting the bulk endpoints
    2. Write directly to your microcontroller's USB controller and reset data toggles

Children