I have a project to implement a simple webcam on an STM32F4 dev board. My start point is the STM32 middleware libraries. From these I could build an example project which functions as a USB audio output.
My game plan is as follows:
- modify the project so the dev board becomes an audio input (to the HOST, a windows/linux PC)
- write a simple routine to make the dev board become an audio tone generator
- add code to sample from a microphone to fill the buffer (also addressing need to sync)
- add USB interface and endpoints so the board becomes a UVC device
- fill a bugger with video data and capture it on the host
- capture frames from a camera and use then to fill the buffer
At the moment the board is recognised as a microphone source on the PC - this by changing the descriptors in the middleware header files (I used an example in the USB 1.0 spec as a guide). Device Manager shows it as working correctly and I can select it as an audio source although of course I cannot record from it.
Now I am looking for the place in the code where I need to fill a buffer, but I don't find it. There are some likely looking routines in the middleware but they don't seem to run. I have found what looks like some config handler for EP0 which needs to be implemented, but I am not sure how.
Next I intend to connect the board to a laptop with wireshark and see what transfers are taking place when the dev board is plugged in.
My question is just to ask whether anyone has any useful tips or references on how to get this going. I am making progress but it is slow going. Anything that would help me understand the STM32 middleware and USB configuration process would be helpful.
(I have downloaded another STM32 extension library which claims to support recording, but when I look into the code, some critical routines do not seem to be implemented, so it seems less than helpful.)