macos上安裝esp-idf v4.2版本
參考
https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/linux-macos-setup.html
安裝 Prerequisites
brew install cmake ninja dfu-util
git下載idf 4.2版本并安裝
git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git esp-idf-4.2
cd esp-idf-4.2
./install.sh esp32 # 指定安裝esp32版本, 注意python版本不能太高,我這里是conda安裝的python3.7

導(dǎo)出環(huán)境變量
. ./export.sh
運(yùn)行hello_world示例(我使用的說(shuō)esp32 wroom模塊)
cd ..
cp -r esp-idf-4.2/examples/get-started/hello_world
cd hello_world
idf.py set-target esp32
idf.py build
然后目錄下面會(huì)生成build文件夾:hello_world/build)
把主板連接到電腦,查看端口號(hào)
ls /dev/cu.*

這里是cu.usbserial-0001
燒錄到開(kāi)發(fā)板
idf.py -p /dev/cu.usbserial-0001 flash # -p 是指定端口號(hào)
查看輸出
idf.py -p /dev/cu.SLAB_USBtoUART monitor # control+] 退出

浙公網(wǎng)安備 33010602011771號(hào)