#平台
VMware 安装ubuntu18
#官方参考
快速入门 - ESP32-S2 - — ESP-IDF 编程指南 latest 文档
#步骤
Step1: 安装相关依赖库
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
如报错按下文处理
Step2: 安装pythen3
sudo apt-get install python3 python3-pip python3-setuptools
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && alias pip=pip3
Step3: 下载ESP-IDF
mkdir -p ~/esp
cd ~/esp
git clone -b release/v4.3 --recursive https://gitee.com/EspressifSystems/esp-idf.git
Step4: 下载工具及更新
cd ~/esp
git clone https://gitee.com/EspressifSystems/esp-gitee-tools.git
cd esp-gitee-tools
./submodule-update.sh ~/esp/esp-idf
Step5: 安装
cd ~/esp/esp-idf
export IDF_GITHUB_ASSETS="dl.espressif.com/github_assets"
./install.sh
Step6: 设置环境变量
. $HOME/esp/esp-idf/export.sh
#问题
#安装依赖库报错
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
#编译命令
~/esp/esp-idf$ . ./export.sh
进入工程目录,如hello_world
idf.py set-target esp32s2
idf.py menuconfig
idf.py build
下载:
idf.py -p /dev/ttyUSB1 flash
监测打印
idf.py -p /dev/ttyUSB1 monitor