2014-01-14 05:52 AM
How do I receive USB IN data with a host using the library mentioned in the title?
Do I have to poll by trying to receive from different IN EPs, or is there some interrupt based state change to indicate whether receive needs to be called or not?Or do I just have to poll URB_State or HC_Status for that EP?Especially I'm trying to receive device notificatons via interrupt IN ep, getting any IN data is important though.2014-01-14 06:39 AM
As of the interrupt IN endpoint, refer to the code in USBH_HID_Handle() (usbh_hid_core.c)
Tsuneo2014-01-14 07:56 AM
The site seems to have problems. Every now and then posting causes some error and an advice is given to find out about the problem using sharepoint tools. (?)
Usually the posting ends up on the site, but this time it didn't.So:It looks like the HID polls the URB_State.How about control/bulk IN (URB state doesn't seem to be set for them) in general case?Should HC_Status be used (after interrupt transfer poll) for control/bulk transfers?MSC host is a bit complicated example (USBH_MSC_Handle + ... + USBH_MSC_HandleBOTXfer).Does HID read double frames, or what's the ''start_toggle''?The state change seems to be:HID_POLL (polling) --> HID_GET_DATAHID_GET_DATA (first frame) --> HID_POLLHID_POLL (second frame) --> HID_POLLOr did I misunderstand something?2014-01-15 11:01 AM
When can a new control transfer be started?
Any time, or should URB_Status have a certain value?How about receiving? When the receiving function returns USBH_OK, is the data ready to be handled, or is it just that the token has been sent? Should one poll for URB_Status to turn to ''done''?Are there any delays needed?2014-01-16 12:10 AM
Ah, now I got the HID example:
HID_GET_DATA is the polling and the start_toggle tells the next stateHID_POLL if the URB_DONE is from old data or new data.(It could hane named ''new_data'' as well.)The state machine loops mostly in HID_POLL state, and when the time comes, it ''drops by'' the HID_GET_DATA state to poll for new data, and when the request sending is finished, it returns to the HID_POLL state.Stating it here for others, that might find the explanation useful.2014-01-16 09:56 AM
Got the RNDIS control message transfer to work. Just bulk I/O missing, but alas, I run out of time. Other people will finish it. Time flies when you're having fun.
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20USB%20On-The-Go%20Host%20and%20Device%20Library%20structure&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=283]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fSTM32%20USB%20On-The-Go%20Host%20and%20Device%20Library%20structure&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=283Fortunately I know enough to help and to guide the guys in, and I have a goot understanding how the bulk I/O should be done.It was quite an intensive course in USB programming, but I got A LOT!Once again: loads and loads of thanks to Tsuneo for being so devoted teacher here.2015-02-23 05:35 AM
Hi
RNDIS looks like something I have to have a look at, do you have anything you are willing to share? Thanks Andy.2015-03-17 04:11 PM