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
137 stars 64 forks source link

The discovery project can not go into USBH_VIDEO_Process() #5

Open liuzhijun23 opened 3 years ago

liuzhijun23 commented 3 years ago

I connect the usb camera(which can work ok on my computer) to my STM32F407 borad,and run the discorery project,I find that the program can not go into USBH_VIDEO_Process(&hUsbHostFS) in USB_HOST_fast_class_call(),I find that the hUsbHostFS.gState = HOST_ABORT_STATE.I don't know the reason.Can you help me? void USB_HOST_fast_class_call(void) { if (hUsbHostFS.gState == HOST_CLASS) { USBH_VIDEO_Process(&hUsbHostFS); } }

liuzhijun23 commented 3 years ago

This is the watch window when run in the iar: image

iliasam commented 3 years ago

Your "bInterfaceClass" value is 0x09. According to https://www.usb.org/defined-class-codes this is hub class. Are you connecting camera by usb-hub?

In my project USBH_MAX_NUM_SUPPORTED_CLASS value is set to 1: https://github.com/iliasam/STM32_HOST_UVC_Camera/blob/master/HAL_source/stm32F4_discovery_project/Inc/usbh_conf.h You can try to increase that value but I'm not sure if that will help.

liuzhijun23 commented 3 years ago

I find the reason now.The project set the usb mode to full speed.But my usb camera worked in high speed mode.So the programe can not find the video interface.I would bought a full speed usb camera and test in another day.