1 入坑準備
工具鏈: Windows 平臺工具鏈
傳送門:https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20190611.zip
聲明該工具可能並不支持最新版,可在你的\esp\esp-idf目錄下,打開命令行執行install.bat
進行下載xtensa-esp32-elf 編譯工具,替換msys2中opt下的相關文件。
eclipse
python,可考慮msys2自帶的,也可以用自己環境中的,此時需要把msys2中python.exe幹掉。並在mingw32.ini中放開MSYS2_PATH_TYPE=inherit
2 安裝
2.1 環境準備
python工具包:在\esp\esp-idf目錄下的requirements.txt文件中,特別注意離線安裝情況下需要
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
以及 windows-curses
這些三方庫可以去
豆瓣 : [https://pypi.douban.com/simple](https://pypi.douban.com/simple)
中國科學科技大學 : [https://mirrors.ustc.edu.cn/pypi/web/simple/](https://mirrors.ustc.edu.cn/pypi/web/simple/)
清華大學 :[https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/](https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/)
之後去到 ${IDF_PATH}/tools/kconfig_new/esp-windows-curses路徑下執行 python setup.py install
2.2 配置環境變量:
msys2中,在etc/profile.d中添加一個`export_idf_path.sh`文件,並在裏面設置號IDF_PATH:
export IDF_PATH="D:/ESP32/esp/esp-idf"
在window環境變量中加入 IDF_PATH,並在path中加入 `%IDF_PATH%\tools`
在msys2下運行mingw32.exe,通過 `echo $PATH` 查看環境變量。
準備好後就可以去esp-idf的example中驗證了。
2.3 驗證
執行make menuconfig
配置串口,硬件等信息
make編譯生成。
之後燒錄進硬件即可