Esp32 compiler error

Another compiler error post I know, Ive read through other posts but i have yet to find a solution.

  1. Restarted arduino id
  2. Tried different esp32 board selections in ide
  3. Deleted and reinstalled esp32 board manager
  4. Deleted files in Arduino 15 and reinstalled
  5. Tried different board types.
  6. tried holding boot button

I have an esp32 wroom 32, devkitv1

I cannot even get the blink sketch to load

Ive used multiple esp's before and never had this issue.
Im on a mac m1 sonoma 14,

Thanks in advanced for any help

FQBN: esp32:esp32:nodemcu-32s
Using board 'nodemcu-32s' from platform in folder: /Users/chris/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14
Using core 'esp32' from platform in folder: /Users/chris/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14

/Users/chris/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/xtensa-esp32-elf-size -A /private/var/folders/d_/f1bcbyw57tn6bch8rmml1zfr0000gp/T/arduino/sketches/D1C1126F4115FCB9F5AFD0079D04DB72/Blink.ino.elf
Sketch uses 237149 bytes (18%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21048 bytes (6%) of dynamic memory, leaving 306632 bytes for local variables. Maximum is 327680 bytes.
"/Users/chris/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool" --chip esp32 --port "/dev/cu.usbserial-0001" --baud 921600  --before default_reset --after hard_reset write_flash  -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 "/private/var/folders/d_/f1bcbyw57tn6bch8rmml1zfr0000gp/T/arduino/sketches/D1C1126F4115FCB9F5AFD0079D04DB72/Blink.ino.bootloader.bin" 0x8000 "/private/var/folders/d_/f1bcbyw57tn6bch8rmml1zfr0000gp/T/arduino/sketches/D1C1126F4115FCB9F5AFD0079D04DB72/Blink.ino.partitions.bin" 0xe000 "/Users/chris/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/partitions/boot_app0.bin" 0x10000 "/private/var/folders/d_/f1bcbyw57tn6bch8rmml1zfr0000gp/T/arduino/sketches/D1C1126F4115FCB9F5AFD0079D04DB72/Blink.ino.bin" 
Traceback (most recent call last):
  File "esptool.py", line 34, in <module>
  File "esptool/__init__.py", line 1032, in _main
  File "esptool/__init__.py", line 674, in main
  File "esptool/__init__.py", line 920, in get_default_connected_device
  File "esptool/loader.py", line 302, in __init__
  File "serial/__init__.py", line 90, in serial_for_url
  File "serial/serialposix.py", line 332, in open
  File "serial/serialposix.py", line 517, in _reconfigure_port
termios.error: (22, 'Invalid argument')
[4908] Failed to execute script 'esptool' due to unhandled exception!
esptool.py v4.5.1
Serial port /dev/cu.usbserial-0001
Failed uploading: uploading error: exit status 1
1 Like

can you try at a baud rate different than 921600 in the tools menu

image

try 1152200 for a start (I know it's a pain to go slower) to see if there is a difference

1 Like

Hi,
no change unfortunetly

I suppose you are using IDE 2.x
have you tried to see if you get the same behavior with the IDE 1.8.19?

yes im getting the same behavior on both

I deleted all the arduino directories and reinstalled, still have same error.

Failed to execute script 'esptool' due to unhandled exception!

I'm not running sonoma so can't replicate... seems to be a python issue with the Serial port

I would try with another cable

see CMake Error at run_serial_tool.cmake:50 ERROR MESSAGE WHEN FLASHING (IDFGH-8959) · Issue #10371 · espressif/esp-idf · GitHub, a cable change did the trick...

1 Like

ooh my, REALLY?
Cant believe that worked X)
Thanks for the advice :slight_smile:

did that work as well for you?

Yes it did, I was using a cable from my raspberry pi. It has always worked with unos, and others inclu esp32's. But not with these dev boards. What exactly is wrong with the cable? Data lines in different config?

It seems the Macs running Apple Silicon are pretty demanding on the quality of the cable.. (USB C is more capable than USB and so I assume decisions are made in the driver based upon the Power Delivery protocol and other specifics of the cable impedance may be?)

1 Like

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