DEV Community

codemee
codemee

Posted on

ESP32 在 Big Sur 無法編譯

如果你把 Mac 升級到 Big Sur, 會發現要使用 ESP32 Arduino core 1.0.4 版編譯 ESP32 專案會出錯:

根據這篇文章的說法, 必須讓 ESP32 控制板套件改用 esptool.py 原始檔, 而不是原本的 esptool 執行檔。步驟如下:

  1. 點選偏好設定中的 preferences.txt 連結, 開啟偏好設定所在的資料夾。
  2. 進入 packages/esp32/hardware/esp32/1.x.x 資料夾中, 開啟 platform.txt 檔。
  3. 將以下這行:

    tools.esptool_py.cmd=esptool
    

    修改成:

    tools.esptool_py.cmd=esptool.py
    
  4. 接著複製 tools 資料夾下的 esptool.py, 貼到你的使用者資料夾下的 ArduinoLibraryFolder/packages/esp32/tools/esptool_py/2.x.x 路徑下。

  5. 為 esptool.py 加上執行權限:

    chmod +x esptool.py
    
  6. 幫系統內建的 Python2 安裝 pyserial。首先安裝 pip 工具:

    curl https://bootstrap.pypa.io/2.7/get-pip.py --output get-pip.py
    python get-pip.py
    

    再利用 pip 工具安裝 pyserial:

    python -m pip install pyserial
    
  7. 重新開啟 Arduino 就可以正常編譯 ESP32 專案了。

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay