简述
乐鑫为了解决国内用户在安装idf开发环境时,因下载过慢导致下载失败的问题,在 gitee 上提出了一套解决方案。下边就让我们按照gitee上的教程来进行环境搭建。
1.克隆esp_tools
mkdir esp-idf
cd esp-idf
git clone https://gitee.com/EspressifSystems/esp-gitee-tools.git
2.克隆esp_idf
为了解决国内开发者从 github 克隆 esp 相关仓库慢的问题,已将 esp-idf 和部分重要仓库及其关联的子模块镜像到了 jihu,这些仓库将自动从原始仓库进行同步。
./esp-gitee-tools/jihu-mirror.sh set
git clone --recursive https://github.com/espressif/esp-idf.git
3.安装开发环境
cd esp-gitee-tools
./install.sh ../esp-idf
4. 设置环境变量
执行命令
vim ~/.bashrc
在文件最后添加(具体路径根据实际情况而定)
alias get_esp32='. /home/chucheng/work.dir/esp-idf/esp-idf/export.sh'
保存退出,执行命令
source ~/.bashrc
使环境变量生效
5. 测试编译环境
执行命令 get_esp32