GPIO Conflict Using Waveshare 4.2" e-Paper (VSPI/HSPI) + Camera on Freenove ESP32 WROVER

Hello,

I'm working on a project using the Freenove ESP32 WROVER board, aiming to integrate both:

  • A Waveshare 4.2-inch e-Paper display (400x300, Rev 2.2)
  • The onboard OV2640 camera module

I'm utilizing the Arduino IDE with the following configurations:

  • e-Paper display library: GxEPD2
  • e-Paper interface:
    • Initially tried VSPI (default SPI: MOSI 23, MISO 19, SCK 18, CS 5, DC 14, RST 12, BUSY 4)
    • Also attempted HSPI (MOSI 13, MISO 12, SCK 14, CS 15, DC 2, RST 4, BUSY 5)
  • Camera library: ESP32 Camera library (Arduino examples)

What I've confirmed so far:

  • The e-Paper display functions correctly when operated alone over VSPI using the GxEPD2 library.
  • The camera operates correctly when run alone using the ESP32 Camera example.
  • The BS jumper on the e-Paper is set to 0 (4-wire SPI mode).
  • The setup() and loop() functions are properly defined in my sketches.
  • I'm using Arduino IDE 2.3.5 and have selected the ESP32 WROVER Module board.

Problem:

When combining the e-Paper and camera code into a single sketch, I encounter GPIO errors or conflicts at runtime:

  • The camera initialization fails.
  • The e-Paper display becomes unresponsive.
  • Error messages such as:
    "
    gpio_install_isr_service(502): GPIO isr service already installed
    camera probe failed with error 0x105 (ESP_ERR_NOT_FOUND)
    "

These issues suggest that the e-Paper and camera are attempting to use overlapping GPIO pins, leading to conflicts.


Details of pin mapping:

  • e-Paper (VSPI):
    • MOSI → GPIO23
    • MISO → GPIO19
    • SCK → GPIO18
    • CS → GPIO5
    • DC → GPIO14
    • RST → GPIO12
    • BUSY → GPIO4
  • e-Paper (HSPI):
    • MOSI → GPIO13
    • MISO → GPIO12
    • SCK → GPIO14
    • CS → GPIO15
    • DC → GPIO2
    • RST → GPIO4
    • BUSY → GPIO5
  • Camera (ESP32 WROVER module defaults):
    • XCLK → GPIO21
    • SIOD → GPIO26
    • SIOC → GPIO27
    • Y9 → GPIO35
    • Y8 → GPIO34
    • Y7 → GPIO39
    • Y6 → GPIO36
    • Y5 → GPIO19
    • Y4 → GPIO18
    • Y3 → GPIO5
    • Y2 → GPIO4
    • VSYNC → GPIO25
    • HREF → GPIO23
    • PCLK → GPIO22

As evident, several GPIOs are shared between the e-Paper and camera modules, leading to the observed conflicts.


What I need help with:

  1. Has anyone successfully run both the camera and an SPI-based display on the ESP32 WROVER?
  2. Which GPIO pins can I safely remap for the e-Paper display to avoid conflicts with the camera module?
  3. Would switching the e-Paper to use software SPI or another SPI bus mitigate these conflicts?
  4. Are there recommended libraries or board configurations for combining SPI devices and a camera on the ESP32 WROVER?

Thank you for your assistance! Any guidance on pin mappings, wiring diagrams, or example sketches would be greatly appreciated.

I moved your topic to a more appropriate forum category @krupa_k.

The Nano Family > Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, when creating a topic please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

You wont be able to 'share' the camera pins with other IO devices.

So the display you want to use will need to go on the remaining free GPIO pins, so how many spare GPIO pins do you have ?

You would be much much better off using one of the ESP32S3 based Camera development boards, they have quite a few more GPIO pins.

Note that the SPI pins on an ESP32 can be assigned to any GPIO pin that is not in use for other stuff.

All SPI busses can be initialized using custom pin maps.
At first glance it seems that if you re-assign the pins of VSPI you will manage to avoid conflict. I am only looking at the MISO, MOSI & SCK, since the other pins that are used are anyway assignable any way you like and don't depend on the SPI bus at all. (CS, RST and sorts)