新建一个ESP32 编译环境,遇到一些坑,把正确的步骤记录在下:
1. 在windows 上安装ubuntu16.04.6 64位虚拟机。vmware.
2. 建立共享目录share
3. 安装交叉编译环境。esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
解压后放在某目录。在/etc/profile 里增加 export PATH=$PATH:/安装目录/xtensa-esp32-elf/bin
4. 安装依赖包
sudo apt-get install git make gcc libncurses5-dev flex bison gperf python-serial
sudo apt-get install python-pip
5. 下载SDK
git clone --recursive https://github.com/espressif/esp-idf.git
6. 升级依赖包
/usr/bin/python -m pip install --user -r /安装目录/esp-idf/requirements.txt
7. 设置环境变量
在/etc/profile 里增加 export IDF_PATH=/安装目录/esp-idf
8. 编译
命令行进入例程目录esp-idf/examples/get-started/hello_world
make menuconfig
make