Posted on July 08, 2015 at 03:25Well you are right, the solution was in my driver, but I'm still not sure where the problem is. Let me explain.
Many Omnivision image sensors have a register called COM10 which, among other things, determines whether the pixel clock will be gated be HREF or not. If bit 5 of this register is set, PCLK does not run during the horizontal blanking period.
This is a very useful option for the case where PCLK is being used as a DMA request, as with it DMA is only requested for valid pixels. This is the way my driver was set up. And with this setup, DCMI was essentially dead.
Now why DCMI would not work if PCLK is off during vertical blanking is a mystery to me, but then a lot a about DCMI is a mystery because the documentation is so scanty. A state diagram would be nice.
As an aside, I've seen a number of forum and blog posts that say that VSYNC interrupts only occur at the end of a frame, not at the start. I see VSYNC ints for every VSYNC as long as they are turned on.
Another minor point with HAL_DCMI_DeInit. The documentation states:
* @brief Deinitializes the DCMI peripheral registers to their default reset
* values.
Well DCMI is a peripheral and I took that comment to mean the DCMI registers were set to their reset value. What really happens is that the DCMI clock is turned off, and all I/O used by DCMI is set to their reset states.
The DCMI registers themselves are never reset and if the clock is turned back on they revert to the values they had when HAL_DCMI_DeInit was called.
Again, thanks for your comments.
Sid