2023-11-21 06:57 AM
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
Solved! Go to Solution.
2023-11-21 07:10 AM
Perhaps look at DISCO and EVAL board level implementations of DCMI either for the L4+, or other related STM32
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.
2023-11-21 06:59 AM
Are you using these resources here?
2023-11-21 07:10 AM
Perhaps look at DISCO and EVAL board level implementations of DCMI either for the L4+, or other related STM32
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.
2023-11-21 07:12 AM
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?
2023-11-21 07:26 AM
I am not sure how much it will help you. Here is a documentation on DCMI on STM32:
2023-11-21 08:28 AM
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?
2023-11-21 08:32 AM
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).
2023-11-21 08:35 AM
>>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.
2023-11-23 01:18 AM - edited 2023-11-23 01:19 AM
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;
}
2023-11-26 03:00 AM - edited 2023-11-26 03:00 AM
I managed it to work. Thank you all for your help!