Showing results for 
Search instead for 
Did you mean: 


Associate II

Hi Community!

My goal is to capture an bmp image with the resolution of 640x480. But to check first if the camera is correct connected and works perfectly, I'm trying to take a JPEG image.

I've successfully connected my Nucleo-L4A6ZG with an Adafruit development board and I am able to communicate with the OV5640 Camera on it. I've managed basic tasks like reading the camera's ID and altering some settings. I want to take a 640x480 resolution picture. However, I'm encountering a challenge while receiving images: although I can detect the JPEG header and end during receiving it, but in the FrameBuffer the JPEG end marker isn't identifiable.

I'm unsure about the root cause of this issue. It might be related to how the data is being captured or processed. Additionally, I'm a bit uncertain about the optimal clock settings for this setup. Any guidance or suggestions on these matters would be greatly appreciated.

Thank you very much for your assistance!

Best Regards, Nicola

ST Employee

Hello @nicola3 ,

DCMI_HSYNC is used to signal the start/end of a packet. DCMI_VSYNC is used to signal the start/end of the
stream. If the full data stream finishes and the detection of an end-of-stream does not occur (DCMI_VSYNC does not
change), the DCMI pads out the end-of-frame by inserting zeros: if the stream size is not a multiple of four, at
the end of the stream, the DCMI pads the remaining data with zeros.


For that, I advise you to check the DCMI_HSYNC and the DCMI_VSYNC parameters which are responsible for start/end of packet and stream respectively. 

Note that in snapshot mode, once the first complete frame is received, the DCMI is automatically disabled (CAPTURE bit automatically cleared), and all the other frames are ignored. In case of an overrun, the frame is lost and the camera interface is disabled.

I think 8.3.7 JPEG data capture example in AN5020 can help you.

Thank you.




To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.