Table of contents
1. Install common software vim, git and python
2. Setting the Standard for the Linux Toolchain
3. Download and install xtensa-lx106-elf [64-bit Linux version]:
4. Download and install ESP8266
1. Install common software vim, git and python
sudo apt-get purge vim-common //输入命令,将vim-common依赖删除
sudo apt-get install vim //下载vim
sudo apt install git //下载git
2. Setting the Standard for the Linux Toolchain
Ubuntu related version: To compile with ESP8266_RTOS_SDK, you need to obtain the following packages:
/**********下载编译工具链**************/
sudo apt-get install gcc git wget make libncurses5-dev flex bison gperf python3 python3-serial
/**********下载基本工具****************/
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools python3-serial python3-click python3-cryptography python3-future python3-pyparsing python3-pyelftools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
ll /usr/bin/python* //查看有没有python
sudo cp /usr/bin/python3 /usr/bin/python //没有的话直接把python3链接给python
//进行更新
sudo apt-get update
sudo apt-get upgrade
3. Download and install xtensa-lx106-elf [64-bit Linux version]:
For version 5.2.0: [Support SDK3.3 and below]
https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
For version 8.4.0: [Support SDK3.4 and above]
https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz
Copy the link Open the browser in the virtual machine and enter the URL, click to download, create the /esp file in the root directory /root, and extract the file into it.
mkdir -p ~/esp //如果根目录下没有esp文件夹,就创建
cd ~/esp //进入esp文件夹下
vim ~/.bashrc //进入vim 操作vim指令
export IDF_PATH="~/esp/ESP8266_RTOS_SDK" //编译不同文件,需要根据实际情况修改路径
export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"
指令操作步骤:// i 插入
// 复制上面两个路径 按键操作:[ctrl] + [shift] + [v] 进行粘贴
// 按键操作:[Esc] 关闭插入
// :wq 保存并退出
source ~/.bashrc //保存更新
xtensa-lx106-elf-gcc -v //查看gcc路径及版本
echo $IDF_PATH //查看操作文件路径及版本
4. Download and install ESP8266
git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git
//默认下载最新版本:第一遍总进不去,第二遍就可以了,如果还不行,reboot重启就行
/*********************可以选择需要版本【3.3及以下版本SDK--对应编译工具5.2.0版本】
git clone -b v3.3 --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git ESP8266_RTOS_SDK_v3.3
/***安装克隆后,需要在ESP8266_RTOS_SDK文件夹下进行操作***/
git submodule update --init --recursive //克隆完毕后进行编译,不在下载证明更新完成
sudo pip freeze > requirements.txt //创建requirements.txt
sudo pip install -r requirements.txt //重新执行命令
/*********************下载esp-andlink******************/
git clone --recursive https://glab.espressif.cn/andlink/esp-andlink.git //需要账号密码