cancel
Showing results for 
Search instead for 
Did you mean: 

STM32: DCMI sends unreadable data to terminal

nicola3
Associate II

Hi Community!

I managed to communicate between the STM32-L4A6 (Nucleo-L4A6ZG) and the OV5640 camera module. I can read the camera's ID, set its modes, and even get image data. But there's a problem: the characters in the data I receive turn into unreadable data at some point (check the video link). Initially, everything looks good, but then it gets messy.

My goal is to send this data to the computer terminal using LUPART. If anyone knows why this is happening or how to fix it, I'd really appreciate the help.

Thank you in advance!

 

Video: https://www.icloud.com/attachment/?u=https%3A%2F%2Fcvws.icloud-content.com%2FB%2FAScrgf68YNAa28dSwi5pD24zZp8wAXrn1SOrfleYcqcKAARhtyqvfYqg%2F%24%7Bf%7D%3Fo%3DAlzB3DNKsDz4UGd-ztn9VnUKmrXMedOrxs9sE2RF_bqM%26v%3D1%26x%3D3%26a%3DCAogLVOIuo5oPnJCJqcbEdn0gv8T-MDYakDbkNWzz6WsFPsSeBDbl9XmvzEY26fQuskxIgEAKgkC...

10 REPLIES 10
KDJEM.1
ST Employee

Hi @nicola3 ,

I' m not able to download an to see the video. Could you please share a screenshot ?

I advise you to take a look to this discussion.

Thank you.

Kaouthar.

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.

nicola3
Associate II

Hi @KDJEM.1 

I'm sorry for the inconvenience. Attached i try it differently but also there are also photos for better understanding.

https://www.icloud.com/iclouddrive/0c9KNk1Qw5IJUURcZClG-pCyw#Screen_Recording_2023-11-23_at_16.32

Thank you very much for your help!


Best regards, 
Nicola

KDJEM.1
ST Employee

Hi @nicola3 ,

Please make sure that data are saved in DMA before starting send via LPUART.

Do you have any issue after converting data to the image? 

As mentioned in this discussion, if you're just sending data over terminal, you aren't going to show anything useful in the terminal. 

Thank you.

Kaouthar

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.

Hi @KDJEM.1 

Thank you for your support. This is my first project with STM and I'm a little bit overwhelmed. 

I don't know how to converting this data into an image and how to save it to the DMA. Do you know how I should be able to do that?

Thank you in advance!

Best regards,

Nicola

KDJEM.1
ST Employee

Hello @nicola3 ,

Thank you for updating post.

This is my first project with STM and I'm a little bit overwhelmed. 

To start with DCMI, I recommend you to take a look to Introduction to digital camera interface (DCMI) for STM32 MCUs Application note. This application note gives to the STM32 users some basic concepts, with easy-to-understand explanations of the features, architecture, and configuration of the DCMI. It is supported by an extensive set of detailed examples (section 8 DCMI application examples).

I don't know how to converting this data into an image and how to save it to the DMA.

You can start from available examples and get inspired to create your own project for example:

To display your image on LCD, DCMI_CaptureMode example can help you. This application descripts how to use the DCMI to interface with a camera module to continuously capture RGB565 images, crop them from size 320x240 to 240x240 then display the video stream on the LCD.

To display capture data or video on your computer display, this example can help you: FP-AI-VISION1_V3.1.0\Projects\STM32H747I-DISCO\Applications\USB_Webcam in FP-AI-VISION1 package.

 I hope this help you!

Thank you.

Kaouthar

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.

Hi @KDJEM.1 

Thank you for your response! I'm trying to get the project "DCMI_CaptureMode" running but I cannot find the wiring diagram for the LCD display.

Do you know where I can find it?

Thank you very much and have a nice day!

Best regards, 

Nicola

Hi @KDJEM.1 

I managed to run it and also to get a JPEG file. Unfortunately, the jpeg converter is not able to translate it to an image. 
I think maybe there is a problem with the clock speed.

Do you have an idea what else could be the problem?
BR

Nicola

Are you able to see / sync on the JFIF headers?

https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format

Should be able to cross check headers, data lengths and structures as the data streams over the DCMI connection.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hey @Tesla DeLorean 

yes i can see the FFD8 and the FFD9 in the data. The FFD9 is always the last one but the FFD8 is sometimes in the middle of the data stream and sometimes somewhere else. It doesn’t make sense. 
Do you know what the problem could be? Is it a clock setting problem? 

BR

Nicola