ESP32 software issue

Hi,
i have two ESP32 WROOM and am attaching to an iMac, with OS 12.6.7 and IDE 1.8.19.
Trying to load the WiFi Scan sketch from the wifi/examples.
When I attempt to load the sketch the side fails, giving me this error-

Arduino: 1.8.19 (Mac OS X), Board: "ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled"

Sketch uses 706205 bytes (53%) of program storage space. Maximum is 1310720 bytes.
Global variables use 42280 bytes (12%) of dynamic memory, leaving 285400 bytes for local variables. Maximum is 327680 bytes.
/Users/vlad/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool --chip esp32 --port /dev/cu.usbmodem55740133451 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 /var/folders/f5/fz862vjx6klfknth0cw6m3qm0000gp/T/arduino_build_208392/WiFiScan.ino.bootloader.bin 0x8000 /var/folders/f5/fz862vjx6klfknth0cw6m3qm0000gp/T/arduino_build_208392/WiFiScan.ino.partitions.bin 0xe000 /Users/vlad/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/tools/partitions/boot_app0.bin 0x10000 /var/folders/f5/fz862vjx6klfknth0cw6m3qm0000gp/T/arduino_build_208392/WiFiScan.ino.bin
esptool.py v4.5.1
Serial port /dev/cu.usbmodem55740133451
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: cc:db:a7:1c:ae:b8
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)
A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I have selected the Board to be "ESP 32 Dev Module"
The serial chip on the board has CH9102X engraved on it, so I have installed the driver for that chip and restarted the iMac.
The driver and the boards and the cable seem to work because I can upload the Wifi scan sketch to both the ESP32 boards using a Windows 10 computer, and then see the local wifi networks in the serial monitor when I attach the boards to the iMac. But I still get the same error message when I try to load the wifi can sketch to the boards using the iMac using either IDE 1.8.19 or 2.2.1.

Has anybody got any idea how to suss how to make the IDEs on my Mac have the same success loading the sketch to the boards?
I'm assuming the Mac's USB driver is ok because the boards report the scanned networks over the USB cable.
Thanks in advance for help.
Fritigern

Hi @fritigern. We sometimes find that mysterious upload failures can be solved by reducing the upload speed, which is configurable via a convenient menu.

Select Tools > Upload Speed > 115200 from the Arduino IDE menus and then try uploading the sketch again, just as you did before. Hopefully this time the upload will be successful. If not, add a reply here on the forum thread to let us know and we'll investigate further.

Optimizing Upload Speed

If the sketch upload no longer failed after reducing the upload speed, you will have determined that the board is not capable of managing uploads at the default 921600 baud, but is capable of them at 115200 baud.

Especially with more complex sketches, the upload will take a significant amount of time at 115200 baud. It is likely that the board is capable of managing uploads at some speed higher than 115200 baud, so it is worth doing some experimentation to determine the maximum speed at which you can reliably upload to the board. You can do this by repeating the "Configure Upload Speed" procedure above, but selecting different speeds each time. Then attempting an upload to see if the new speed is appropriate.

Hi @ptillisch.
Thank you very much for your reply.
I tried slowing down the transfer speed as suggested and still got the same error.
I tried all the available speeds with no success.
I also verified that the wifiScan sketch did load onto the boards using a Windowss10 computer- it still did, so I compared the settings on both computers, they are exactly the same.
Really weird!
Thank you again.
Fritigern

Unfortunately I don't have any ideas. I did a bit of research, but it seems that it is not a very common problem. I only found one report of someone solving it:

The fact that they installed the CP210x driver makes me think their board uses one of the Silicon Labs chips (e.g., CP2102). In that case I would not expect that solution to be applicable to a board like yours that uses a chip from a different manufacturer (WCH in the case of the CH9102X). However, I did notice something strange in that post:

I would expect that the wch in the wchusbserial port name is an indicator that the port was produced by a WCH brand chip?

WCH specifically designed the CH9102 as an alternative to the CP2102. The chip is pin compatible, so it can be used as a replacement on PCBs that were originally designed for the CP2102. That doesn't mean that the same driver can be used for either one (and I would actually expect just the opposite), but maybe it is worth a try anyway if nobody has any better idea for something to try.

Thank you, @ptillisch, for looking. I guess it is a mystery, the chip driver allows the ESP32s to talk to my iMac, but not the other direction. I'll have to use Windows 10 to upload to them.
Cheers

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.