cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-L4A6 with OV5640

nicola3
Associate II

Hello Community!
I am a newcomer to STM and am currently trying to control the OV5640 with the STM32-L4A6 (NUCLEO-L4A6ZG).

Unfortunately I have no success and cannot establish communication. I am biting my teeth out and am in urgent need of support. I am using the developer board from Adafruit (https://learn.adafruit.com/adafruit-ov5640-camera-breakout/overview).

Does anyone have an example project or can help me in any other way?
I would be very grateful!

Thank you very much and have a nice day.
Kind regards

Nicola

1 ACCEPTED SOLUTION

Accepted Solutions

Perhaps look at DISCO and EVAL board level implementations of DCMI either for the L4+, or other related STM32

https://www.st.com/content/ccc/resource/training/technical/product_training/group0/ec/99/3b/61/b3/96/49/1b/STM32H7-Peripheral-Digital_Camera_Interface_DCMI/files/STM32H7-Peripheral-Digital_Camera_Interface_DCMI.pdf/_jcr_content/translations/en.STM32H7-Peripheral-Digital_Camera_Interface_DCMI.pdf

Get an I2C interface up so you can communicate with the camera.

Make sure you can get to the DCMI pins on the NUCLEO, and there aren't any conflicted pins. Grab the schematic from the "CAD Resources" tab of the board page. The data manual for the chip should enumerate the DCMI pins.

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

View solution in original post

9 REPLIES 9
liaifat85
Senior III

Are you using these resources here?

https://github.com/STMicroelectronics/stm32-ov5640

Perhaps look at DISCO and EVAL board level implementations of DCMI either for the L4+, or other related STM32

https://www.st.com/content/ccc/resource/training/technical/product_training/group0/ec/99/3b/61/b3/96/49/1b/STM32H7-Peripheral-Digital_Camera_Interface_DCMI/files/STM32H7-Peripheral-Digital_Camera_Interface_DCMI.pdf/_jcr_content/translations/en.STM32H7-Peripheral-Digital_Camera_Interface_DCMI.pdf

Get an I2C interface up so you can communicate with the camera.

Make sure you can get to the DCMI pins on the NUCLEO, and there aren't any conflicted pins. Grab the schematic from the "CAD Resources" tab of the board page. The data manual for the chip should enumerate the DCMI pins.

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

Hi liafiat85

Unfortunately i clicked the solution button :grinning_face_with_sweat:. Yeah it considered using these ressources. The problem is that I am not able to communicate with the I2C and the DCMI. Because this is all new to me and I tried it so many times, but always failed.
Can you help me with this problem?

I am not sure how much it will help you. Here is a documentation on DCMI on STM32:

https://www.st.com/resource/en/application_note/an5020-digital-camera-interface-dcmi-on-stm32-mcus-stmicroelectronics.pdf

At the end of this paper there is a example. At 8.3.2.4 I'm getting confused. Because the STM32-L4A6 does not have the stream and so I can't choose the FIFO principle. Do you know anything about that?

nicola3
Associate II

I have already a code for the adafruit, but it is for an stm32-f4 and so I can't implement it to my STM32-L4. Do you know a workaround or how i can adapt this (see: https://www.waveshare.com/wiki/OV5640_Camera_Board_(A) -> code).

>>Because this is all new to me and I tried it so many times, but always failed.

Unfortunately that communicates very little detail.

What specifically have you tried? Perhaps describe in a document, as to what exactly was tried, what the observations were. What you checked with a scope or logic analyzer.

How is this wired up, what I2C interface is it connected too? What code have you used to communicated via I2C? Show the code.

Start with the I2C. There should be far more examples of that.

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

Hi Community!

I found out, that even the communication of the STM to the OV5640 doesn't work. I couldn't get the ID of the Camera with I2C.

When i run the Init-loop in main.c in the file ov5640.c I'm not able to read from the register the default values (0x56 and 0x40, see code down below or in attachment). I connected the SDA to the GPIO B9 and the SCL to the B8. My reg does not get the 0x5640, it receives 0xffff.

Does anyone know why?

Thank you in advance!

 

Code:

uint16_t i=0;

uint16_t reg;

OV5640_POWER_ON; // Power on 

HAL_Delay(30);

reg=OV5640_RD_Reg(OV5640_CHIPIDH); // default value: 0x56

reg<<=8;

reg|=OV5640_RD_Reg(OV5640_CHIPIDL); // default value: 0x40

if(reg!=OV5640_ID){

   printf("ID: %d \r\n",reg);

   return 1;

}

 

I managed it to work. Thank you all for your help!