OV5642 with arduino2

ourarios
Mon Jun 04, 2018 11:37 am
Hello,
I work with STM32L4 IOT but my problem is the same in all STM32 cards.
I want to activate the Arducam OV5642 camera.
the camera is functional with arduino uno but with STM32 no.
I think the problem is at the SPI interface but I have not found a solution.
the error message is about SPI interface.
please help me.

fpiSTM
Mon Jun 04, 2018 12:07 pm
If you want some support you should precise your issue.
Host OS? Arduino version, core used, error log, libraries used…

ourarios
Mon Jun 04, 2018 12:17 pm
I use STM32L4 IOT and (the same for STM32F4)
I take the example arducam for arduino. this example is functional with arduino uno and mega.
Image
exemple .. arducam .. mini ..OV5642
but with STM32L4 IOT that supports arduino is not functional and the problem the SPI interface

stevestrong
Mon Jun 04, 2018 12:50 pm
Please post some links to HW and used SW.
Which IDE?

ourarios
Mon Jun 04, 2018 1:20 pm
Okay
it’s exactly this example but I’m using STM32.
https://www.youtube.com/watch?v=hybQpjwJ4aA&t=118s

fpiSTM
Mon Jun 04, 2018 1:44 pm
You probably use the STM Core for L4 IOT.
Anyway, which lib you used?
This one?
https://github.com/ArduCAM/Arduino/tree/master/ArduCAM

but with STM32L4 IOT that supports arduino is not functional and the problem the SPI interface
So it’s seems to build correctly but why you told this is the SPI interface the issue?

If you are not more precise you will not get help.
So, please, give us all relevant information, lib you used, sketch used, how you wired the cam, which SPI pins you used on the board…


ourarios
Mon Jun 04, 2018 2:10 pm
okey
the program is the same of exemple : https://www.youtube.com/watch?v=hybQpjwJ4aA&t=246s
i use : http://www.st.com/en/evaluation-tools/b … ot01a.html
in the host arducam.exe i have error SPI interfacing.
i told u SPI problem because :
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include "memorysaver.h"
//This demo can only work on OV5642_MINI_5MP_Plus platform.
//#if !(defined OV5642_MINI_5MP_PLUS)
// #error Please select the hardware platform and camera module in the ../libraries/ArduCAM/memorysaver.h file
//#endif
#define BMPIMAGEOFFSET 66
const char bmp_header[BMPIMAGEOFFSET] PROGMEM =
{
0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,
0x00, 0x00
};
// set pin 7 as the slave select for the digital pot:
const int CS = 7;
bool is_header = false;
int mode = 0;
uint8_t start_capture = 0;
ArduCAM myCAM( OV5642, CS );
uint8_t read_fifo_burst(ArduCAM myCAM);
void setup() {
// put your setup code here, to run once:
uint8_t vid, pid;
uint8_t temp;
#if defined(__SAM3X8E__)
Wire1.begin();
Serial.begin(115200);
#else
Wire.begin();
Serial.begin(921600);
#endif
Serial.println(F("ACK CMD ArduCAM Start!"));
// set the CS as an output:
pinMode(CS, OUTPUT);
// initialize SPI:
SPI.begin();
while(1){
//Check if the ArduCAM SPI bus is OK
myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
temp = myCAM.read_reg(ARDUCHIP_TEST1);
if (temp != 0x55){
Serial.println(F("ACK CMD SPI interface Error!"));
delay(1000);continue;
}else{
Serial.println(F("ACK CMD SPI interface OK."));break;
}
}

Rick Kimball
Mon Jun 04, 2018 2:19 pm
Why aren’t you using an esp8266?

ourarios
Mon Jun 04, 2018 2:25 pm
because the STM32L4 IOT card have an integrated WIFI module

Rick Kimball
Mon Jun 04, 2018 2:27 pm
It doesn’t seem to be simple to integrate with the stm32l4, why don’t you pick a supported platform that has WIFI?

ourarios
Mon Jun 04, 2018 2:52 pm
I am in the project of end of study and my subject with the card STM32L4

Rick Kimball
Mon Jun 04, 2018 2:54 pm
Well it seems like you will have to dig in and figure out what is going on. We aren’t going to be able to help you. You seem to refuse to provide us any information. We can guess why it doesn’t work but I’m guessing you are going to fail this class.

ourarios
Mon Jun 04, 2018 3:03 pm
.
I give all the information. It’s exactly like the video

fpiSTM
Mon Jun 04, 2018 3:20 pm
Rick is right.
A video is not a correct input to request support.
Uno is fairly different to STM32 for many reasons. (
Libraries used probably require some update to support STM32 core…

stevestrong
Mon Jun 04, 2018 3:47 pm
You did not give a link to the Arducam software. Arducam has at least 5 versions. Which one do you use? https://github.com/ArduCAM

You did not give a link to the used STM32 software. Are you using STM32cube?


zoomx
Mon Jun 04, 2018 3:55 pm
[ourarios – Mon Jun 04, 2018 12:17 pm] –
exemple .. arducam .. mini ..OV5642
but with STM32L4 IOT that supports arduino is not functional and the problem the SPI interface

I believe that you have the shield Arducam.

As far as I know, I don’t have this hardware, the shield take a photo then you have to download from the shield, using SPI, and record it on a SD, that use the same SPI.
Since Arduino has only 2k this is done alternating communications, you download a little chunk, then write it to sd, thake another chunk…
This require an arbitration over SPI using the SS signal and maybe this can be the issue: chosing the right SS pins, one for the arducam shield and one for the SD.

I see that some arducam shields has an sd slot but I don’t know if this SD is connected to Arduino or used by the shield. Maybe the problem is only to choose the right SS pin for communicating with the shield.

Take in account that STM32 works at 3.3V levels and maybe your shield not. Some Arducam works with RaspberryPI so uses 3.3V levels.

So we need to know which shield you have.


ourarios
Tue Jun 05, 2018 6:41 am
because in my project you have to use STM32L4 IOT

Leave a Reply

Your email address will not be published. Required fields are marked *