iliasam / STM32_HOST_UVC_Camera

Example of connecting USB Web camera to STM32F4 USB HOST
http://we.easyelectronics.ru/STM32/zahvat-izobrazheniya-s-usb-kamery-pri-pomoschi-stm32.html
GNU Lesser General Public License v3.0
145 stars 66 forks source link

USBH_LL_GetLastXferSize returns 0. #1

Closed pauleffect90 closed 4 years ago

pauleffect90 commented 4 years ago

Hi. Lemme start by saying "thank you", for posting this great example. I've used it to succesfully open a webcam. However, on USBH_VIDEO_InputStream volatile uint32_t rxlen = USBH_LL_GetLastXferSize(phost, VIDEO_Handle->camera.Pipe);//Return the last transfered packet size. always returns 0. After reading your articles (those linked by you - thank god for google translate), I understood that this might be caused by the usb FIFO size. I changed the value up to 256, however I can't seem to get any data. Always rxlen 0. I'm trying to get 640x480 frames (fps does not matter), and the endpoint im using is 1022 bytes long. PS: I'm not trying to send the frames over to the PC or store them or whatever. Just getting the packets would be perfect. Any kind of help would be greatly appreciated!

iliasam commented 4 years ago

Hello. Are you sure that your camera could work in Full Speed mode? Sometimes is is possible to switch USB of the PC in BIOS to FS - so you can try to check that camera is working in FS mode.

pauleffect90 commented 4 years ago

Yes. I hooked it up to a rpi zero (fs usb only) and it works. I started with this check, after checking out your linked article.

iliasam commented 4 years ago

I'm sorry, I don't have any ideas about that problem now.

pauleffect90 commented 4 years ago

Ok, thank you anyway. If I find out what's wrong, I'll paste it here.