iliasam / STM32_HOST_UVC_Camera

Example of connecting USB Web camera to STM32F4 USB HOST

Home Page:http://we.easyelectronics.ru/STM32/zahvat-izobrazheniya-s-usb-kamery-pri-pomoschi-stm32.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TEST: Porting to STM32F779

MASTERTECH-AndreaRuberti opened this issue · comments

Hi iliasam,
just now thanks for your project...
during my porting I meet some diffilculty, but still now I can't understard what is exactly the problem... maybe you can easly found the mistake.

##My Configuration:##
HW:

  • Custom board with STM32F779;
  • External RAM;
  • LCD connected by LTCD->DSI->LVDS_converter;
  • USB CAM Logitech V-U0013 (should be the same you use for your tests);
    SW:
  • ARM-GCC compiler;
  • makefile;

##Project changes##

  • Adapt pinout to my board;
  • Add DSI + LVDS converter startup;
  • ADD F7 HAL (release 1.17.0 - last one);
  • Patch "usb_host.c" generated by CubeMX with changes in your sources;
  • Patch "stm32f4xx_ll_usb.c" by Lib with changes in your sources;
  • NO Patch "stm32f4xx_hal_hcd" in Lib: (hhcd->hc[ch_num].ep_type == EP_TYPE_ISOC)) fix already present in the HAL version!

##ISSUES:##

  • I need to change
    usbh_video.c = if ((ep_size > ep_size_in) && (ep_size < UVC_RX_FIFO_SIZE_LIMIT)) -> if ((ep_size > ep_size_in) && (ep_size <= UVC_RX_FIFO_SIZE_LIMIT)) : "ep_size" for my CAM is always 1024!!!
    (Have_ you ever notice this _problem???)
  • The uvc_prev_packet_eof never goes to 1: condition if (tmp_packet_framebuffer[UVC_HEADER_BIT_FIELD_POS] & UVC_HEADER_EOF_BIT) never happend.

Many thanks again for your project.
Andrea

just as info...
I receive only 2 len of pck in "video_stream_process_packet":
12B: Header
192B: ???

Never receive a greater pck!

Hi.
Sorry, but have not worked with UVC a long time so I can't help you.

Hi,
Thanks for your replay...
please... just last question.
Now I'm able to start the video transfer, but performence too poor:

  • uncompress: 5 fps @160x120;
  • mjpeg: 8 fps @160x120 or 2/3 fps @320x240

About mjpeg I nead to understand how M7 could be slower than Cortex M4 ??? (to be honest I also need to investigate on external ram timing).

But what it's really strange is the 5fps on uncompress video.
The bottleneck seams to be the video pck send by the camera "USBH_LL_GetLastXferSize" always return 192Byte)
The Logitech camera shoud be the same... so your pck size was 192Byte or 1024 Byte???

Many thanks for your help
kindly regards
Andrea

"The Logitech camera shoud be the same... so your pck size was 192Byte or 1024 Byte???"
Sorry, I can't remember that.