Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools report "bad CPU type in executable" on Mac (IDFGH-7758) #9300

Closed
buckybots opened this issue Jul 6, 2022 · 10 comments
Closed

Tools report "bad CPU type in executable" on Mac (IDFGH-7758) #9300

buckybots opened this issue Jul 6, 2022 · 10 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@buckybots
Copy link

followed simple directions on new Mac. going in circles between export.sh and install.sh

  1. completed the Mac tools setup
  2. installed esp-idf : git clone -b v4.4.1 --recursive https://github.com/espressif/esp-idf.git
  3. tried to complete tools setup, but can not get idf.py to be recognized, as tools will not set up due to missing xtensa elf files etc. as seen below.
  4. I tried and retried this setup a couple of times.
  5. The instructions are straightforward, but there is a problem with this 'stable' release on Mac. I also run on Windows machine, and that setup works fine.

here are the errors:
eric@erics-Mac-mini esp-idf % ./install.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.12
"python3" has been detected
Installing ESP-IDF tools
Selected targets are: esp32s3, esp32c3, esp32h2, esp32s2, esp32
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32s2-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32s3-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool riscv32-esp-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing riscv32-esp-elf@esp-2021r2-patch3-8.4.0
file riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing esp32ulp-elf@2.28.51-esp-20191205
file binutils-esp32ulp-macos-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/binutils-esp32ulp-macos-2.28.51-esp-20191205.tar.gz to /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing esp32s2ulp-elf@2.28.51-esp-20191205
file binutils-esp32s2ulp-macos-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/binutils-esp32s2ulp-macos-2.28.51-esp-20191205.tar.gz to /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool openocd-esp32 version v0.11.0-esp32-20211220 is present, but tool was not found
Installing openocd-esp32@v0.11.0-esp32-20211220
file openocd-esp32-macos-0.11.0-esp32-20211220.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/openocd-esp32-macos-0.11.0-esp32-20211220.tar.gz to /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220
Installing Python environment and packages
Python 3.9.12
pip 22.0.4 from /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pip (python 3.9)
Installing Python packages from /Users/eric/esp/esp-idf/requirements.txt
Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
Ignoring None: markers 'sys_platform == "win32"' don't match your environment
Requirement already satisfied: setuptools>=21 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 4)) (62.1.0)
Requirement already satisfied: click>=7.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 8)) (8.1.3)
Requirement already satisfied: pyserial>=3.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 9)) (3.5)
Requirement already satisfied: future>=0.15.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 10)) (0.18.2)
Requirement already satisfied: cryptography>=2.1.4 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (37.0.4)
Requirement already satisfied: pyparsing<2.4.0,>=2.0.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 18)) (2.3.1)
Requirement already satisfied: pyelftools>=0.22 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 19)) (0.28)
Requirement already satisfied: idf-component-manager~=1.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.1.4)
Requirement already satisfied: gdbgui==0.13.2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.13.2.0)
Requirement already satisfied: pygdbmi<=0.9.0.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 25)) (0.9.0.2)
Requirement already satisfied: python-socketio<5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 28)) (4.6.1)
Requirement already satisfied: jinja2<3.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 29)) (3.0.3)
Requirement already satisfied: itsdangerous<2.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 30)) (2.0.1)
Requirement already satisfied: kconfiglib==13.7.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 32)) (13.7.1)
Requirement already satisfied: reedsolo<=1.5.4,>=1.5.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 35)) (1.5.4)
Requirement already satisfied: bitstring>=3.1.6 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 36)) (3.1.9)
Requirement already satisfied: ecdsa>=0.16.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 37)) (0.17.0)
Requirement already satisfied: construct==2.10.54 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 41)) (2.10.54)
Requirement already satisfied: Flask<1.0,>=0.12.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.12.5)
Requirement already satisfied: Flask-SocketIO<3.0,>=2.9 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (2.9.6)
Requirement already satisfied: Pygments<3.0,>=2.2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (2.12.0)
Requirement already satisfied: Flask-Compress<2.0,>=1.4.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.12)
Requirement already satisfied: gevent<2.0,>=1.2.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.5.0)
Requirement already satisfied: cffi>=1.12 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from cryptography>=2.1.4->-r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (1.15.1)
Requirement already satisfied: pyyaml>5.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (6.0)
Requirement already satisfied: schema in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.7.5)
Requirement already satisfied: requests-toolbelt in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.9.1)
Requirement already satisfied: tqdm<5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (4.64.0)
Requirement already satisfied: colorama in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.4.5)
Requirement already satisfied: contextlib2>0.6.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (21.6.0)
Requirement already satisfied: requests<3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2.28.1)
Requirement already satisfied: six in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.16.0)
Requirement already satisfied: python-engineio<4,>=3.13.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from python-socketio<5->-r /Users/eric/esp/esp-idf/requirements.txt (line 28)) (3.14.2)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from jinja2<3.1->-r /Users/eric/esp/esp-idf/requirements.txt (line 29)) (2.1.1)
Requirement already satisfied: pycparser in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=2.1.4->-r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (2.21)
Requirement already satisfied: Werkzeug<1.0,>=0.7 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from Flask<1.0,>=0.12.2->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.16.1)
Requirement already satisfied: brotli in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from Flask-Compress<2.0,>=1.4.0->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.0.9)
Requirement already satisfied: greenlet>=0.4.14 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gevent<2.0,>=1.2.2->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.1.2)
Requirement already satisfied: certifi>=2017.4.17 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2022.6.15)
Requirement already satisfied: idna<4,>=2.5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.26.9)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2.1.0)
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/Users/eric/.espressif/python_env/idf4.4_py3.9_env/bin/python -m pip install --upgrade pip' command.
All done! You can now run:

. ./export.sh

eric@erics-Mac-mini esp-idf % . ./export.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.12
"python3" has been detected
Adding ESP-IDF tools to PATH...
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool riscv32-esp-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32s2ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool openocd-esp32 version v0.11.0-esp32-20211220 is present, but tool was not found
ERROR: tool openocd-esp32 has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
eric@erics-Mac-mini esp-idf % cd ..
eric@erics-Mac-mini esp % cd hello_world
eric@erics-Mac-mini hello_world % . $HOME/esp/esp-idf/export.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.12
"python3" has been detected
Adding ESP-IDF tools to PATH...
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool riscv32-esp-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32s2ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool openocd-esp32 version v0.11.0-esp32-20211220 is present, but tool was not found
ERROR: tool openocd-esp32 has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
eric@erics-Mac-mini hello_world % /Users/eric/esp/esp-idf/install.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.12
"python3" has been detected
Installing ESP-IDF tools
Selected targets are: esp32c3, esp32s3, esp32h2, esp32, esp32s2
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32s2-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing xtensa-esp32s3-elf@esp-2021r2-patch3-8.4.0
file xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool riscv32-esp-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
Installing riscv32-esp-elf@esp-2021r2-patch3-8.4.0
file riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-macos.tar.gz to /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing esp32ulp-elf@2.28.51-esp-20191205
file binutils-esp32ulp-macos-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/binutils-esp32ulp-macos-2.28.51-esp-20191205.tar.gz to /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
Installing esp32s2ulp-elf@2.28.51-esp-20191205
file binutils-esp32s2ulp-macos-2.28.51-esp-20191205.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/binutils-esp32s2ulp-macos-2.28.51-esp-20191205.tar.gz to /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205
WARNING: directory for tool openocd-esp32 version v0.11.0-esp32-20211220 is present, but tool was not found
Installing openocd-esp32@v0.11.0-esp32-20211220
file openocd-esp32-macos-0.11.0-esp32-20211220.tar.gz is already downloaded
WARNING: destination path already exists, removing
Extracting /Users/eric/.espressif/dist/openocd-esp32-macos-0.11.0-esp32-20211220.tar.gz to /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220
Installing Python environment and packages
Python 3.9.12
pip 22.0.4 from /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages/pip (python 3.9)
Installing Python packages from /Users/eric/esp/esp-idf/requirements.txt
Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
Ignoring None: markers 'sys_platform == "win32"' don't match your environment
Requirement already satisfied: setuptools>=21 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 4)) (62.1.0)
Requirement already satisfied: click>=7.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 8)) (8.1.3)
Requirement already satisfied: pyserial>=3.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 9)) (3.5)
Requirement already satisfied: future>=0.15.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 10)) (0.18.2)
Requirement already satisfied: cryptography>=2.1.4 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (37.0.4)
Requirement already satisfied: pyparsing<2.4.0,>=2.0.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 18)) (2.3.1)
Requirement already satisfied: pyelftools>=0.22 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 19)) (0.28)
Requirement already satisfied: idf-component-manager~=1.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.1.4)
Requirement already satisfied: gdbgui==0.13.2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.13.2.0)
Requirement already satisfied: pygdbmi<=0.9.0.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 25)) (0.9.0.2)
Requirement already satisfied: python-socketio<5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 28)) (4.6.1)
Requirement already satisfied: jinja2<3.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 29)) (3.0.3)
Requirement already satisfied: itsdangerous<2.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 30)) (2.0.1)
Requirement already satisfied: kconfiglib==13.7.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 32)) (13.7.1)
Requirement already satisfied: reedsolo<=1.5.4,>=1.5.3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 35)) (1.5.4)
Requirement already satisfied: bitstring>=3.1.6 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 36)) (3.1.9)
Requirement already satisfied: ecdsa>=0.16.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 37)) (0.17.0)
Requirement already satisfied: construct==2.10.54 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from -r /Users/eric/esp/esp-idf/requirements.txt (line 41)) (2.10.54)
Requirement already satisfied: Flask-Compress<2.0,>=1.4.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.12)
Requirement already satisfied: Flask-SocketIO<3.0,>=2.9 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (2.9.6)
Requirement already satisfied: Flask<1.0,>=0.12.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.12.5)
Requirement already satisfied: gevent<2.0,>=1.2.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.5.0)
Requirement already satisfied: Pygments<3.0,>=2.2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (2.12.0)
Requirement already satisfied: cffi>=1.12 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from cryptography>=2.1.4->-r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (1.15.1)
Requirement already satisfied: colorama in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.4.5)
Requirement already satisfied: six in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.16.0)
Requirement already satisfied: pyyaml>5.2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (6.0)
Requirement already satisfied: requests<3 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2.28.1)
Requirement already satisfied: contextlib2>0.6.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (21.6.0)
Requirement already satisfied: tqdm<5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (4.64.0)
Requirement already satisfied: requests-toolbelt in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.9.1)
Requirement already satisfied: schema in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (0.7.5)
Requirement already satisfied: python-engineio<4,>=3.13.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from python-socketio<5->-r /Users/eric/esp/esp-idf/requirements.txt (line 28)) (3.14.2)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from jinja2<3.1->-r /Users/eric/esp/esp-idf/requirements.txt (line 29)) (2.1.1)
Requirement already satisfied: pycparser in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=2.1.4->-r /Users/eric/esp/esp-idf/requirements.txt (line 12)) (2.21)
Requirement already satisfied: Werkzeug<1.0,>=0.7 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from Flask<1.0,>=0.12.2->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (0.16.1)
Requirement already satisfied: brotli in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from Flask-Compress<2.0,>=1.4.0->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.0.9)
Requirement already satisfied: greenlet>=0.4.14 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from gevent<2.0,>=1.2.2->gdbgui==0.13.2.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 22)) (1.1.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2022.6.15)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/eric/.espressif/python_env/idf4.4_py3.9_env/lib/python3.9/site-packages (from requests<3->idf-component-manager~=1.0->-r /Users/eric/esp/esp-idf/requirements.txt (line 20)) (2.1.0)
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/Users/eric/.espressif/python_env/idf4.4_py3.9_env/bin/python -m pip install --upgrade pip' command.
All done! You can now run:

. /Users/eric/esp/esp-idf/export.sh

eric@erics-Mac-mini hello_world % . /Users/eric/esp/esp-idf/export.sh
Detecting the Python interpreter
Checking "python" ...
Checking "python3" ...
Python 3.9.12
"python3" has been detected
Adding ESP-IDF tools to PATH...
WARNING: directory for tool xtensa-esp32-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s2-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s2-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool xtensa-esp32s3-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool xtensa-esp32s3-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool riscv32-esp-elf version esp-2021r2-patch3-8.4.0 is present, but tool was not found
ERROR: tool riscv32-esp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool esp32s2ulp-elf version 2.28.51-esp-20191205 is present, but tool was not found
ERROR: tool esp32s2ulp-elf has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
WARNING: directory for tool openocd-esp32 version v0.11.0-esp32-20211220 is present, but tool was not found
ERROR: tool openocd-esp32 has no installed versions. Please run '/Users/eric/esp/esp-idf/install.sh' to install it.
eric@erics-Mac-mini hello_world % idf.py
zsh: command not found: idf.py
eric@erics-Mac-mini hello_world %

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 6, 2022
@github-actions github-actions bot changed the title esp-idf programming guide for v4.4.1 (stable) "Get Started" fails on Mac esp-idf programming guide for v4.4.1 (stable) "Get Started" fails on Mac (IDFGH-7758) Jul 6, 2022
@dobairoland
Copy link
Collaborator

Hi @buckybots. What chip architecture is used in your Mac?

Could you please try to run one of the tools manually and post here the output? For example:

~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version

xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2-patch3) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@buckybots
Copy link
Author

Thanks for looking at this! Here is what I get:

eric@erics-Mac-mini hello_world % ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version
zsh: bad CPU type in executable: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
eric@erics-Mac-mini hello_world %

using the apple help I get :
Hardware Overview:

Model Name: Mac mini
Model Identifier: Macmini9,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
System Firmware Version: 7429.61.2
OS Loader Version: 7429.61.2

This is macOS Monterey
Version 12.1

Mac mini(M1,2020)
Chip Apple M1
Memory 16GB

I've tried several versions of esp-idf, none of them work, master, release 4.4, release 4.3, stable 4.4.1

@buckybots
Copy link
Author

I am trying to use the visual studio code setup. I tried the express setup. I think you are correct that there is a CPU error. Here is the part of the output window during the visual studio code setup :

idf_versions.txt progress: 100.00% (0.08 / 0.08) KB
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32s3-elf version
Error: Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32s2-elf version
Error: Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32-elf version
Error: Command failed: xtensa-esp32-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable
Command failed: riscv32-esp-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable
Error checking riscv32-esp-elf version
Error: Command failed: riscv32-esp-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable
Command failed: esp32s2ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable
Error checking esp32s2ulp-elf version
Error: Command failed: esp32s2ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable
Command failed: openocd --version
/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable
Error checking openocd-esp32 version
Error: Command failed: openocd --version
/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable
Command failed: esp32ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable
Error checking esp32ulp-elf version
Error: Command failed: esp32ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable

idf_versions.txt has (1) KB
idf_versions.txt progress: 100.00% (0.08 / 0.08) KB
/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable
Command failed: esp32ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable
Error checking esp32ulp-elf version
Error: Command failed: esp32ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin/esp32ulp-elf-as: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable
Command failed: riscv32-esp-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable
Error checking riscv32-esp-elf version
Error: Command failed: riscv32-esp-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32s3-elf version
Error: Command failed: xtensa-esp32s3-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32s2-elf version
Error: Command failed: xtensa-esp32s2-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
Command failed: xtensa-esp32-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
Error checking xtensa-esp32-elf version
Error: Command failed: xtensa-esp32-elf-gcc --version
/bin/sh: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable
Command failed: openocd --version
/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable
Error checking openocd-esp32 version
Error: Command failed: openocd --version
/bin/sh: /Users/eric/.espressif/tools/openocd-esp32/v0.11.0-esp32-20211220/openocd-esp32/bin/openocd: Bad CPU type in executable

/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable
Command failed: esp32s2ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable
Error checking esp32s2ulp-elf version
Error: Command failed: esp32s2ulp-elf-as --version
/bin/sh: /Users/eric/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin/esp32s2ulp-elf-as: Bad CPU type in executable

@dobairoland dobairoland changed the title esp-idf programming guide for v4.4.1 (stable) "Get Started" fails on Mac (IDFGH-7758) Tools report "bad CPU type in executable" on Mac (IDFGH-7758) Jul 8, 2022
@dobairoland
Copy link
Collaborator

Thank you for the additional info. I've updated the title to reflect the cause of the issue. We will get back to you....

@antmak
Copy link
Collaborator

antmak commented Jul 8, 2022

Hi @buckybots. It seems something wrong with Rosetta environment on the mac m1.

Could you check and share output follow up commands, please:

arch -x86_64 ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version
arch -arm64 ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version
lsbom -f /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom

Normally, all IDF Tools v4.4 run with Rosetta translator on M1 computers. Rosetta should be installed in system.

@buckybots
Copy link
Author

eric@erics-Mac-mini ~ % arch -x86_64 ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version
arch: posix_spawnp: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
eric@erics-Mac-mini ~ % arch -arm64 ~/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --version
arch: posix_spawnp: /Users/eric/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc: Bad CPU type in executable
eric@erics-Mac-mini ~ % lsbom -f /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom

can't open /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom: No such file or directory
**** Can't open /Library/Apple/System/Library/Receipts/com.apple.pkg.RosettaUpdateAuto.bom.
eric@erics-Mac-mini ~ %

@buckybots
Copy link
Author

I don't know about Rosetta translator. I did try IDF Tools v4.3 and master, they did not work either.

@buckybots
Copy link
Author

buckybots commented Jul 8, 2022

Googled Roseeta on Mac, got the following, I will try to install it and try again.

If you need to install Rosetta on your Mac
Rosetta 2 enables a Mac with Apple silicon to use apps built for a Mac with an Intel processor.

How to install Rosetta
Rosetta 2 is available only for Mac computers with Apple silicon.

@buckybots
Copy link
Author

buckybots commented Jul 8, 2022

Yes, mac with M1 chip needs rosetta 2.

In terminal I ran the following, and it fixed the problem:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

@antmak
Copy link
Collaborator

antmak commented Jul 11, 2022

@buckybots thanks a lot for that cli recipe!

@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new labels Jul 11, 2022
espressif-bot pushed a commit that referenced this issue Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants