run: sudo chmod 777 /dev/ttyUSB0 idf.py flash monitor
1.下载esp-idf和esp-gitee-tools包
#三行不要少了
cd ~
git clone https://gitee.com/EspressifSystems/esp-idf.git
git clone https://gitee.com/EspressifSystems/esp-gitee-tools.git
2.配置环境
sudo apt install git python python3 python3-pip python-pip cmake ninja-build
3.配置环境
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
4.配置环境
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
5.配置环境
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
pip config set global.trusted-host mirrors.aliyun.com
cp ~/esp-gitee-tools/submodule-update.sh ~/esp-idf/submodule-update.sh
rm ~/esp-idf/install.sh
cp ~/esp-gitee-tools/install.sh ~/esp-idf/install.sh
~/esp-idf/submodule-update.sh ~/esp-idf
~/esp-idf/install.sh ~/esp-idf
6.拷贝例子
cd ~
cp ~/esp-idf/examples examples
7.编译
cd ./examples/get-started/hello_world
. ~/esp-idf/export.sh
idf.py set-target esp32c3
idf.py app
8.下载&monitor
cd ./examples/get-started/hello_world
. ~/esp-idf/export.sh
sudo chmod 777 /dev/ttyUSB0
idf.py flash monitor