ARDUCAM with STM32L476

Working libraries, libraries being ported and related hardware
Post Reply
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

ARDUCAM with STM32L476

Post by mebab »

Hi,

I used to have ARDUCAM ov2640 with Arduino 101. Now, I have developed the application on STM32L476 and use Arduino IDE. I have defined SPI pins according to the new platform. The program works util the following command and stops:

Code: Select all

    while(!myCAM.get_bit(ARDUCHIP_TRIG , CAP_DONE_MASK));
Do you know what has to be considered to fix this error?

Thanks in advance.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: ARDUCAM with STM32L476

Post by fpiSTM »

Well, I don't think the error is here.
It seems this line wait forever the CAP_DONE_MASK bits of the ARDUCHIP_TRIG register is 0.

#define ARDUCHIP_TRIG 0x41 //Trigger source
#define CAP_DONE_MASK 0x08

the get_bit fall back on a SPI read so are you sure your wiring is correct ?
Do you have a logic analyzer to spy SPI ?
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: ARDUCAM with STM32L476

Post by mebab »

#define ARDUCHIP_TRIG 0x41 //Trigger source
#define CAP_DONE_MASK 0x08
Above comment didn't help since the same values exist.
the get_bit fall back on a SPI read so are you sure your wiring is correct ?
With different Chip select pins for each SPI devices, I use the same SPI pins (MOSI, MISO, SCK) to connect to:
1. ARDUCAM
2. LoRa
3. SD card socket

ARDUCAM has also I2c pins (SDA and SCL) that are connected.

When all three devices are connected, it works with Arduino 101 but not with Nucleo64L476. Meanwhile, I have connected a 5.7 Kohm pull-up resistor with the MISO pin and another 5.7 Kohm pull-down with the CK pin.
The following is the relevant part of output after the system starts up:

Code: Select all

CPU is working with f= 80000000 Hz
LoRa init succeeded.
LoRa Simple Node

SD card exists on SmartEye (SN-side)
Initializing SD card...initialization done.
SD Card Volume size= 7616 Mb
-------------------------------------

ArduCAM Start!
SPI interface OK.

OV2640 detected.

Start Capture -->  // This is the point where it stops (as already mentioned)
I have two questions:
1. What is the reason that ARDUCAM cannot work with STM32L476 or Nucleo64L476?
2. Do I need to install STM32 based ARDUCAM library or the one designated for Arduino should still work?
Post Reply

Return to “Libraries & Hardware”