为 ESP32 构建 MicroPython 的自动化脚本

以下脚本安装 esp-idf、所需的依赖项,然后为 ESP32 构建 MicroPython。

build_micropython_esp32.sh
apt -y update && apt -y install python3 python3-pip cmake
# 安装 esp-idf
git clone --depth 1 -b v4.4.3 https://github.com/espressif/esp-idf.git /opt/esp-idf
cd /opt/esp-idf && git submodule update --init --recursive && ./install.sh

# 克隆 micropython
git clone --depth 1 -b v1.19.1 https://github.com/micropython/micropython.git /opt/micropython

# 构建 micropython
cd /opt/micropython/ && make -C mpy-cross
# 构建 micropython@esp32
cd /opt/micropython/ports/esp32 && source /opt/esp-idf/export.sh && make submodules && make -j4

Check out similar posts by category: Embedded, ESP8266/ESP32, MicroPython