ESP-PROG Compatibility with ESP32-CAM

omerfarukkara
Posts: 4
Joined: Tue Oct 19, 2021 4:59 am

ESP-PROG Compatibility with ESP32-CAM

Postby omerfarukkara » Tue Oct 19, 2021 5:19 am

Hello everyone, :roll:

I was following a tutorial from a website where they teach how to connect the ESP-PROG board in its entirety including the debugger and programmer. I was able to connect the programmer by identifying the correct pins on both ESP-PROG and ESP32-CAM. However, I ran into a problem where I had to make the connection between the programmer and ESP-32CAM. In the tutorial, it is stated that the connection between these two boards must have an "EN" pin on the ESP32-CAM but, on the contrary, the board I have does not have such a pin.

ESP-PROG
espprog.png
The pins on the ESP-PROG board
espprog.png (216.29 KiB) Viewed 5782 times
ESP32-CAM
esp32cam.png
The pins on the ESP32-CAM board
esp32cam.png (85.19 KiB) Viewed 5782 times


:? My queries are:
  • Are we sure that the ESP-PROG is compatible with ESP32-CAM in terms of "programming" apart from debugging?
  • If so, what should we do with the "EN" pin?
  • If not, should we connect both ESP-PROG and ESP32-CAM to a computer in order to program + debug?

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: ESP-PROG Compatibility with ESP32-CAM

Postby ESP_Minatel » Tue Oct 19, 2021 11:01 am

Hi,
Are we sure that the ESP-PROG is compatible with ESP32-CAM in terms of "programming" apart from debugging?
Yes. ESP-PROG is compatible with all ESP SoC's series.
If so, what should we do with the "EN" pin?
If you don't have the EN (Reset) pin available, you can tie the BOOT pin (GPIO0 on ESP32) and power on the board. You can use the jumper on the ESP-PROG but take care to use the 3V3 and not the 5V if you are powering the board by the 3V3.
If not, should we connect both ESP-PROG and ESP32-CAM to a computer in order to program + debug?
You can use the GPIO12 to 15 to connect the JTAG interface to the ESP-CAM. See this reference for more information about it.

To use the JTAG interface, you can use this document as reference: JTAG Debug

omerfarukkara
Posts: 4
Joined: Tue Oct 19, 2021 4:59 am

Re: ESP-PROG Compatibility with ESP32-CAM

Postby omerfarukkara » Tue Oct 19, 2021 11:59 am

If you don't have the EN (Reset) pin available, you can tie the BOOT pin (GPIO0 on ESP32) and power on the board. You can use the jumper on the ESP-PROG but take care to use the 3V3 and not the 5V if you are powering the board by the 3V3.
Can you elaborate more on this issue? I don't want to harm my hardware just because I didn't understand you correctly. :?
  • I adjust the output voltage of ESP-PROG for 3v3
power.jpg
power.jpg (33.46 KiB) Viewed 5720 times
  • and then I do what?
You said that I can connect the boot pin (GPIO0 on ESP32) with the power pin on the ESP-PROG board.
The tutorial I follow suggests that I should connect the ESP32-CAM's GPIO0 pin to the 6th pin of ESP-PROG board. (6th pin is the pin shown in the figure)
espprogpins.png
espprogpins.png (480.47 KiB) Viewed 5720 times
After this inspection, how should I connect the programmer pins to my ESP32-CAM? The GPIO0 pin on the ESP32-CAM is already occupied by the looks of it. :(

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: ESP-PROG Compatibility with ESP32-CAM

Postby ESP_Minatel » Tue Oct 19, 2021 2:09 pm

Hi,

No problem.
and then I do what?
To flash the firmware using the ESP-PROG (assuming you will use the UART not JTAG), you need to get the ESP32 into "Download Mode".
You need to hold the GPIO0 in a low state (0) and then put EN to low and release it while still holding the GPIO0 low. After that, you can release GPIO0.

This can be done automatically by the ESP-PROG, but you need both pins available on your board. Since you don't have the EN pin, but you have the push button (marked as RST on ESP-CAM), the best way to get into download mode is by tieing the GPIO0 to ground (GND) using a ~10k resistor and then pressing the RST button or power cycle the board by removing and putting back the jumper on ESP-PROG.

To connect ESP-PROG to ESP-CAM:

ESP-CAM -> ESP-CAM
GPIO0 -> PULL DOWN to enter into download mode
GPIO1 -> RX
GPIO3 -> TX
GND -> GND
3.3V -> 3.3V (you can also power the ESP-CAM using the 5V pin)

Don't forget to release the GPIO0 after programming.

omerfarukkara
Posts: 4
Joined: Tue Oct 19, 2021 4:59 am

Re: ESP-PROG Compatibility with ESP32-CAM

Postby omerfarukkara » Thu Oct 21, 2021 5:07 pm

Hi, :roll:
ESP-CAM -> ESP-CAM
GPIO0 -> PULL DOWN to enter into download mode
GPIO1 -> RX
GPIO3 -> TX
GND -> GND
3.3V -> 3.3V (you can also power the ESP-CAM using the 5V pin)
I apply the necessary connections like you said, there is an issue with the pin layout you suggested. I think the correct layout should be like this:

ESP-PROG -> ESP-CAM
GPIO0 -> PULL DOWN
GPIO1 -> TX
GPIO3 -> RX
GND-> GND
3v3 -> 3v3

GPIO3 and GPIO1 should change their places. Apart from this, I got an error message while flashing my empty program into ESP-PROG and the message is:

Code: Select all

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
*** [upload] Error 2
================================================================================== [FAILED] Took 27.99 seconds ==================================================================================

Environment    Status    Duration
-------------  --------  ------------
Release        FAILED    00:00:27.990
============================================================================= 1 failed, 0 succeeded in 00:00:27.990 ============================================================================= 
The terminal process "C:\Users\omerf\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'Release'" terminated with exit code: 1.

I connect GPIO0 to GND via a 10k resistor like this:
gpio10k.png
gpio10k.png (41.16 KiB) Viewed 5537 times
I tried holding RST down while flashing but it did not work.

This is my config file for vscode with platform io

Code: Select all

[common]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32dev
framework = arduino
monitor_port = COM5
monitor_speed = 115200
upload_port = COM5
upload_speed = 921000
[env:Release]
platform = ${common.platform}
board = ${common.board}
framework = ${common.framework}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
upload_port = ${common.upload_port}
upload_speed = ${common.upload_speed}
[env:Debug]
platform = ${common.platform}
board = ${common.board}
framework = ${common.framework}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
upload_port = ${common.upload_port}
upload_speed = ${common.upload_speed}
debug_tool = esp-prog
debug_init_break = tbreak setup
Do you have any idea why this might occur? :|

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: ESP-PROG Compatibility with ESP32-CAM

Postby ESP_Minatel » Thu Oct 21, 2021 6:16 pm

Hi,

GPIO0 -> PULL DOWN to enter into download mode
GPIO1 -> RX on ESP-PROG
GPIO3 -> TX on ESP-PROG
GND -> GND
3.3V -> 3.3V (you can also power the ESP-CAM using the 5V pin)

Do you see a message like this one after booting the ESP-CAM?

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x6 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
waiting for download

omerfarukkara
Posts: 4
Joined: Tue Oct 19, 2021 4:59 am

Re: ESP-PROG Compatibility with ESP32-CAM

Postby omerfarukkara » Thu Oct 28, 2021 11:09 am

Code: Select all

Processing Debug (platform: https://github.com/platformio/platform-espressif32.git; board: esp32dev; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.3.2+sha.1e0f147) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - tool-mkspiffs 2.230.0 (2.30)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 28 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\Debug\src\main.cpp.o
Generating partitions .pio\build\Debug\partitions.bin
Archiving .pio\build\Debug\libFrameworkArduinoVariant.a
Compiling .pio\build\Debug\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\Print.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\WString.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\base64.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-log.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-touch.c.o
C:\Users\omerf\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c: In function 'spiTransferBytesNL':
C:\Users\omerf\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];
                                       ^
C:\Users\omerf\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_data8 = &last_data;
                                        ^
Compiling .pio\build\Debug\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\Debug\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\Debug\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\Debug\FrameworkArduino\main.cpp.o
Compiling .pio\build\Debug\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\Debug\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\Debug\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\Debug\libFrameworkArduino.a
Linking .pio\build\Debug\firmware.elf
Retrieving maximum program size .pio\build\Debug\firmware.elf
Checking size .pio\build\Debug\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.0% (used 13224 bytes from 327680 bytes)
Flash: [==        ]  15.4% (used 201216 bytes from 1310720 bytes)
Building .pio\build\Debug\firmware.bin
esptool.py v3.1
Merged 1 ELF section
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Use manually specified: COM8
Uploading .pio\build\Debug\firmware.bin
esptool.py v3.1
Serial port COM8
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
*** [upload] Error 2
========================================================================================= [FAILED] Took 35.33 seconds =========================================================================================

Environment    Status    Duration
-------------  --------  ------------
Debug          FAILED    00:00:35.327
==================================================================================== 1 failed, 0 succeeded in 00:00:35.327 ==================================================================================== 
The terminal process "C:\Users\omerf\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'Debug'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.
I get this, I do not know why. I connected everything like you said.

This shows how my connections are
circuitschematic.png
circuitschematic.png (1.94 MiB) Viewed 5294 times
during

Code: Select all

Connecting........_____....._____....._____....._____....._____....._____....._____
part, I press RST on ESP-CAM but nothing happens.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 78 guests