{"action":"created","issue":{"url":"https://api.github.com/repos/libopencm3/libopencm3/issues/668","repository_url":"https://api.github.com/repos/libopencm3/libopencm3","labels_url":"https://api.github.com/repos/libopencm3/libopencm3/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/libopencm3/libopencm3/issues/668/comments","events_url":"https://api.github.com/repos/libopencm3/libopencm3/issues/668/events","html_url":"https://github.com/libopencm3/libopencm3/issues/668","id":163627436,"number":668,"title":"usb stack doesn't recover from timeouts.","user":{"login":"jhoenicke","id":897826,"avatar_url":"https://avatars.githubusercontent.com/u/897826?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoenicke","html_url":"https://github.com/jhoenicke","followers_url":"https://api.github.com/users/jhoenicke/followers","following_url":"https://api.github.com/users/jhoenicke/following{/other_user}","gists_url":"https://api.github.com/users/jhoenicke/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoenicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoenicke/subscriptions","organizations_url":"https://api.github.com/users/jhoenicke/orgs","repos_url":"https://api.github.com/users/jhoenicke/repos","events_url":"https://api.github.com/users/jhoenicke/events{/privacy}","received_events_url":"https://api.github.com/users/jhoenicke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-04T08:30:36Z","updated_at":"2016-07-05T23:03:30Z","closed_at":null,"body":"Our device sometimes does long computations, in which it currently doesn't call usbd_poll() regularly.  If at this time the usb hid devices are enumerated the OS sends `GET_DESCRIPTOR STRING` requests which timeouts since the usb handler is not called.   Unfortunately afterwards the device will never recover.  Even when usbd_poll is then called regularly, the `GET_DESCRIPTOR STRING` requests are not answered properly.  They also cause long delays in the USB communication.  This causes the device to become almost unusable.\r\n\r\nI tried to make some small test that exhibits the problem (you need to adapt it to your hardware though). You need some program on the PC side that causes the STRINGs to be requested while  the device is busy (\"usb is off\").  These will timeout but also the requests that are sent when the device is not busy anymore (\"usb is back\") will timeout.\r\n\r\nhttps://gist.github.com/jhoenicke/13dd9d32ee03488993805f122bb840fd\r\n\r\nThe original bug report is here: trezor/trezor-mcu#98"},"comment":{"url":"https://api.github.com/repos/libopencm3/libopencm3/issues/comments/230628038","html_url":"https://github.com/libopencm3/libopencm3/issues/668#issuecomment-230628038","issue_url":"https://api.github.com/repos/libopencm3/libopencm3/issues/668","id":230628038,"user":{"login":"zyp","id":153099,"avatar_url":"https://avatars.githubusercontent.com/u/153099?v=3","gravatar_id":"","url":"https://api.github.com/users/zyp","html_url":"https://github.com/zyp","followers_url":"https://api.github.com/users/zyp/followers","following_url":"https://api.github.com/users/zyp/following{/other_user}","gists_url":"https://api.github.com/users/zyp/gists{/gist_id}","starred_url":"https://api.github.com/users/zyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyp/subscriptions","organizations_url":"https://api.github.com/users/zyp/orgs","repos_url":"https://api.github.com/users/zyp/repos","events_url":"https://api.github.com/users/zyp/events{/privacy}","received_events_url":"https://api.github.com/users/zyp/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T23:03:30Z","updated_at":"2016-07-05T23:03:30Z","body":"After reading out a SETUP packet, you could check if there's more contents in the RXFIFO and if so read GRXSTSR to check what it is. If it's another SETUP packet, you can just skip further processing of the previous one."}}
{"actor":{"display_login":"zyp"}}