此篇博客用来阐述 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 下的工程
ESP-ADF 中适配 ESP32-S2 开发板的例程参见 “ESP32 and ESP32-S2 Audio Boards Examples”
在
menuconfig配置选项中选择ESP32-S2-Kaluga-1开发板测试
idf.py menuconfig —> Audio HAL —> Audio board
cd examples/cli
idf.py set-target esp32s2 //选择 esp32s2 的芯片环境
idf.py menuconfig //选择 ESP32-S2-Kaluga 开发板
idf.py build
idf.py flash monitor


2849

被折叠的 条评论
为什么被折叠?



