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编译生成。
之后烧录进硬件即可