OV5640 over DCMI odd artifcacting at 720p with Jpeg compression
I'm running into a pixel mismatch issue when trying to capture frames over DCMI from a [B-CAMS_OMV with an OV5640 sensor board attached. I've used CubeMX and the stm32-disco F746 development board to successfully collect RGB565 and JPEG image compression data in various formats and resolutions.
Below is my CubeMX generated DCMI configuration:
hdcmi.Instance = DCMI;
hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;
hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_HIGH;
hdcmi.Init.CaptureRate = DCMI_CR_ALTERNATE_4_FRAME;
hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
hdcmi.Init.JPEGMode = DCMI_JPEG_ENABLE;
hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;
hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;
hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;
hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;
The OV5640 board is attached to an ST module, and I've written a driver heavily influenced by the [VISION-AI](https://www.st.com/en/embedded-software/fp-ai-vision1.html) example typically used with the H7 discovery board.
Using a FreeRTOS task to start the frame capture in snapshot mode, the frame is DMAed (highest priority) to external SDRAM. Once the HAL_DCMI_FrameEventCallback is triggered, the data can be analyzed.
I can successfully capture images in RGB565 at 640x480, and JPEG compression by the sensor at 640x480, 800x480, and almost 1200x720. However, I'm seeing some odd but consistent pixelation/artifacting, and I can't figure out the cause (see horizontal stripe pixalition in picture below). This always appears in a similar spot toward the left side of the frame.
I have tried multiple cameras and multiple DCMI ribbon cables, including very short ones (under 4 inches). Since the image is clear, the camera register values seem to be correct. The frame size is often less than uncompressed 640x480 RGB 565, so It doesn't seem to be an issue with frame size, or dmaing that amount of data.
Access to data in the external sdRam is mutex protected and only DCMI is ever writing to that memory.
Any help or guidance would be appreciated.
