ESP32 Cam Programming

For general Flowcode discussion that does not belong in the other sections.
Post Reply
mnfisher
Valued Contributor
Posts: 938
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 502 times

ESP32 Cam Programming

Post by mnfisher »

I was trying to get an ESP32Cam board working from within Flowcode - This is programmed VIA an FDTI converter.

FC - itself 'seems' to offer the ESP32-Camera board - I went with this - but upload doesn't work as is. (Note you need TX->UDR and Rx to UDT, IO0 to Gnd - and need to press reset to init programming (button on the underside of the board which is poor for breadboard work).

Anyway - using a simple blinkie - uploading from FC fails.

I tried uploading from command line. So - going to ProgramName/build and then pasting the FC command line - this needs -z adding
esptool.py -p COM7 -b 115200 --before default_reset --after hard_reset --chip esp32 write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 esp-project.bin
This works - and pulling the IO0-Gnd jumper and resetting bkinkie works okay.

Anyone any ideas why this shouldn't / might not be okay. I'll add to a new config file and have some more play...

Edit - with in0 grounded pressing reset enters the bootloader. After the jumper to in0 is removed - press reset again to run the program.

Martin

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: ESP32 Cam Programming

Post by stefan.erni »

Hi Martin

I'm not sure what hardware you're using.
I found a module with 20 pins in the ESP32 Pack from Flowcode under Supported Devices.
But what hardware is that with 20 Pin?

There are various small USB modules to program the ESP32. Some also support the reset pin. You no longer have to press the reset button

regards

Stefan

Which module is that?
ESP32_TCam2022-08-04_9-46-39.jpg
ESP32_TCam2022-08-04_9-46-39.jpg (51.56 KiB) Viewed 1384 times

mnfisher
Valued Contributor
Posts: 938
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 502 times

Re: ESP32 Cam Programming

Post by mnfisher »

Its https://www.arducam.com - i see there are now boards for it to plug into with usb support.

As mentioned - adding -z to the command line allowed me to program it - although needs me to hit reset and short in0 to gnd.

Martin

mnfisher
Valued Contributor
Posts: 938
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 502 times

Re: ESP32 Cam Programming

Post by mnfisher »

Had some difficulties getting this to work 'reliably'....

So I upgraded to the latest (possibly) version of esptool.

This is now an .exe file - and I'm wary of breaking my esp32 build environment.

In (your esp-idf install directory) \components\esptool_py\esptool - rename esptool.py esptool.bak

Add esptool.exe (I copied v3.3 from the Arduino install)

Create a small python program - esptool.py - since the 'upload' attempts to use this:

Code: Select all

import sys, os

command = sys.argv[0].replace(".py", "")
for arg in sys.argv[1:]:
    command = command + " " + arg
    
os.system(command)
This simply takes the command line passed to esptool.py and passes in to esptool.exe instead (there is probably a better way to do this)

Now I can reliably upload - and replacing 115200 with 460800

Code: Select all

for arg in sys.argv[1:]:
    if arg == "115200":
        arg = "460800"
Works with the faster baud rate (changing it using idf.py menuconfig doesn't seem to affect things...)

- So not pretty - but seems to work well.. Make a backup before testing :-)

Martin

mnfisher
Valued Contributor
Posts: 938
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 502 times

Re: ESP32 Cam Programming

Post by mnfisher »

Try setting baud to 230400 if not reliable at 460800.... Lot depends on the setup here.

I also tried 921600 (the FTDI chip 'should' cope) - but no joy. I'm running the esp32 on a 'marginal' power supply (I've noticed a few brownout errors) - which might affect things?I

Not sure what the -z option does - and wasn't needed using new esptool. Wasn't listed using -h option. I added it because the archive ide command line only differed in this respect.

MartinG

Post Reply