Pin problem in connection of ArduCAM

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Pin problem in connection of ArduCAM

Post by mebab »

Hi. I have an 'OV2640 ArduCAM' that works fine with Arduino. I use Nucleo64 with the same connection and get the following errors. Since I use A4 and A5 as I2c pins, I have followed the datasheet [SB51 and SB56 must be OFF to connect I2C on A4 (pin 5) and A5 (pin 6 of CN8)].
Line 52 in the code is:
#include <ArduCAM.h>

Errors are:

Code: Select all

In file included from D:\CAM_Test.ino:52:
C:\Program Files (x86)\Arduino\libraries\ArduCAM/ArduCAM.h:695:2: error: 'regtype' does not name a type
  695 |  regtype *P_CS;
      |  ^~~~~~~
C:\Program Files (x86)\Arduino\libraries\ArduCAM/ArduCAM.h:696:2: error: 'regsize' does not name a type
  696 |  regsize B_CS;
      |  ^~~~~~~
exit status 1
Error compiling for board Nucleo-64.
What can be the reason since I use the same connections as Arduino?

Thanks for any help.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Pin problem in connection of ArduCAM

Post by GonzoG »

Are you sure that ArduCAM library supports STM32 MCUs ??
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Pin problem in connection of ArduCAM

Post by fpiSTM »

It seems It supports the STM32 core: https://github.com/ArduCAM/Arduino/pull/460
It seems you don't use the latest version of arducam library as the error line does not match the latest version of ArduCAM.h
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: Pin problem in connection of ArduCAM

Post by mebab »

fpiSTM wrote: Sat Dec 26, 2020 7:21 am It seems It supports the STM32 core: https://github.com/ArduCAM/Arduino/pull/460
It seems you don't use the latest version of Arducam library as the error line does not match the latest version of ArduCAM.h
Thanks for your comment. I updated the library from

Code: Select all

https://github.com/ArduCAM/Arduino
There is no error message now. However, it causes a conflict with the LoRa shield connection. The error message is:

Code: Select all

LoRa init failed. Check your connections
The above error message is generated from the following in my code:

Code: Select all

  if (!LoRa.begin(frequency)) {
    Serial.println("LoRa init failed. Check your connections.");
    while (true);                       // if failed, do nothing
  }
I cannot figure out what is the problem yet!


Thanks for any help
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Pin problem in connection of ArduCAM

Post by fpiSTM »

Check the Nucleo 64 schematic and user manual. IIRW D0 and D1 are not connected as they are used by the STLink. I've got the issue with the Lora Shield.
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: Pin problem in connection of ArduCAM

Post by mebab »

fpiSTM wrote: Tue Dec 29, 2020 10:11 am Check the Nucleo 64 schematic and user manual. IIRW D0 and D1 are not connected as they are used by the STLink. I've got the issue with the Lora Shield.
I use LoRa (Ra-02) that doesn't use Tx, Rx. Therefore, I don't use D0 and D1.
I was in doubt about A3 and A4 connected to SCL and SDA of CAMERA. I tried to make SB51 and SB56 off. However, it didn't work as well.
My Connections are as follows:
Nucleo ------ Ra-02 -------- OV2640
D2-------------- DIO0 -----------------
D3-------------- RST-------------------
D7-------------- --- -------------- CS
D10-------------CS-----------------
D11-------------MOSI------------MOSI
D12-------------MISO------------MISO
D13-------------SCK--------------SCK
A4 -------------- --- --------------SDA
A5---------------------------------SCL
ozcar
Posts: 143
Joined: Wed Apr 29, 2020 9:07 pm
Answers: 5

Re: Pin problem in connection of ArduCAM

Post by ozcar »

You have mentioned disconnecting/removing SB51 and SB56, but have you connected SB46 and SB52?
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: Pin problem in connection of ArduCAM

Post by mebab »

ozcar wrote: Fri Jan 01, 2021 10:28 pm You have mentioned disconnecting/removing SB51 and SB56, but have you connected SB46 and SB52?
I did so with all four SB51,.. It didn't help and still there is a conflict between OV2640 and LoRa(Ra-02).
ozcar
Posts: 143
Joined: Wed Apr 29, 2020 9:07 pm
Answers: 5

Re: Pin problem in connection of ArduCAM

Post by ozcar »

Brevity may be the soul of wit, but it can be the bane of problem diagnosis.

Did you check what I2C pins are used by default, and do something to override if necessary?

What exactly do you mean when you say that there is a conflict between OV2640 and Ra-02? Does that mean that the OV2640 works using the same pins as you showed above, provided you don't use the Ra-02? If that is what you mean, what makes the difference, do you have to physically remove the Ra-02, or does OV2640 work if you just take all references to Ra-02 from your code?
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: Pin problem in connection of ArduCAM

Post by mebab »

ozcar wrote: Sat Jan 02, 2021 9:03 pm Brevity may be the soul of wit, but it can be the bane of problem diagnosis.

Did you check what I2C pins are used by default, and do something to override if necessary?

What exactly do you mean when you say that there is a conflict between OV2640 and Ra-02? Does that mean that the OV2640 works using the same pins as you showed above, provided you don't use the Ra-02? If that is what you mean, what makes the difference, do you have to physically remove the Ra-02, or does OV2640 work if you just take all references to Ra-02 from your code?
As soon as LoRa+CAM is connected (doesn't matter CAM is activated or not), I get the error message that I already mentioned:

Code: Select all

LoRa init failed. Check your connections
On Nucleo:: They work alone. Either only LoRa or only CAM. Then as you mentioned I have to physically remove either Ra-02 or OV2640. Since I set LoRa and CAM in the 'setup', then it goes through that part and stuck on the above error message that is generated from the following code:

Code: Select all

  if (!LoRa.begin(frequency)) {
    Serial.println("LoRa init failed. Check your connections.");
    while (true);                       // if failed, do nothing
  }
On Arduino:: They work either alone or together.
Post Reply

Return to “IDE's”