Ubuntu18.04 上 ESP32-S2 的 ESP-ADF 编译环境搭建流程

此篇博客用来阐述 Ubuntu18.04 上 ESP32-S2 的 ESP-ADF 编译环境搭建流程。

注:ESP-ADF 适配 ESP32-S2 的开发板需要使用 esp-idf release/v4.2 及以上版本的编译环境

1 环境搭建前提

1.1 安装编译 ESP-IDF 需要的软件包:
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
1.2 安装 Python 3.8
sudo apt-get install python3.8-venv python3.8-dev
1.3 选择 python3 环境:
sudo update-alternatives --config python
1.4 安装 install pip

使用 pip 安装以下 python 软件包

python -m pip install pyyaml xlrd

python -m pip --version
1.5 安装 curses
sudo apt-get install libncurses5-dev

2 创建一个空的 文件夹来存放 esp-adf SDK

cd esp

mkdir esp-adf-master-32s2

3 克隆 esp-adf

cd esp-adf-master-32s2 

git clone --recursive https://github.com/espressif/esp-adf.git

4 更新 esp-adf 子仓库

cd esp-adf                                              

git submodule update --init -f --recursive

git pull

5 删掉 esp-adf 下的 esp-idf

rm -rf esp-idf

6 在 esp-adf 目录下重新克隆 release/v4.2 版本的 esp-idf

git clone -b release/v4.2 --recursive https://github.com/espressif/esp-idf.git

7 更新 esp-idf 子仓库

cd esp-idf

git submodule update --init --recursive

8 设置 esp-adf 下的 esp-idf 环境变量和运行 esp-idf 工具链

export IDF_PATH=$(pwd)

./install.sh 

. ./export.sh

9 回退到 esp-adf 目录下,设置 esp-adf 环境变量

cd ..

export ADF_PATH=$(pwd)

10 借助 esp-idf 的工具链脚本,为 esp-adf 设置工具链

pwd        

. $HOME/esp/esp-adf-master-32s2/esp-adf/esp-idf/export.sh

11 编译 esp-adf 下的工程

cd examples/cli 

idf.py set-target esp32s2           //选择 esp32s2 的芯片环境

idf.py menuconfig                  //选择 ESP32-S2-Kaluga 开发板

idf.py build

idf.py flash monitor

说明:

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值