1. 程式人生 > >esp32-ubuntu16.04編譯環境搭建

esp32-ubuntu16.04編譯環境搭建

1,linux 使用Windows 10 Linux 子系統 ubuntu 16.04

2,安裝編譯鏈

sudo apt-get install git make gcc libncurses5-dev flex bison gperf python-serial

從這裡獲取最新的編譯鏈,Linux 64bit的

http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html#install-prerequisites

cd /home/jacob

wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz

sudo tar zxvf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz -C /opt/esp

sudo vi /etc/environment

最後新增/opt/esp/xtensa-esp32-elf/bin

source /etc/environment

xtensa-esp32-elf-gcc -v

驗證通過,即可。

2,增加idf sdk

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

設定IDF_PATH到/etc/profile的最後

即在最後加入:export IDF_PATH=/media/jacob/Files/git_workspace/esp-idf

命令列:source /etc/profile

使環境變數生效

3,編譯應用

make 

make menuconfig

參考文章

http://blog.csdn.net/flyingcys/article/details/72186736

http://blog.csdn.net/flyingcys/article/details/72183706

http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html#install-prerequisites

https://segmentfault.com/a/1190000012119486

補充:

menuconfig的依賴項:
sudo apt-get install libncurses5-dev libncursesw5-dev


flex也要安裝
sudo apt-get install flex