温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

esp-open-sdk在mac os x上的安装步骤

发布时间:2021-07-30 18:32:27 来源:亿速云 阅读:248 作者:chen 栏目:互联网科技

本篇内容主要讲解“esp-open-sdk在mac os x上的安装步骤”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“esp-open-sdk在mac os x上的安装步骤”吧!

esp-open-sdk是用于编译ESP8266微型WiFi和CPU一体化的芯片固件的工具链创建工具(不是工具链本身),里面使用crosstool-NG以及gcc、binutils等工具来生成xtensa-lx106-elf工具链,ESP8266的固件使用所创建出来的工具链进行编译。

esp-open-sdk主要在linux上运行(参考https://github.com/pfalcon/esp-open-sdk),通过mac port也可以在mac os x上运行,按照下面的脚本运行即可。

这个脚本来自于http://www.esp8266.com,但我运行时出现一些错误,可能与版本有关,目前的版本最终编译成功。

crosstool-NG原始版本来自于https://github.com/jcmvbkbc/crosstool-NG  。

可以尝试安装新的sed, gperf and grep解决出现的问题(Yosemite 10.10.1):

brew install gnu-sed --with-default-names
brew tap homebrew/dupes
brew install gperf
brew install grep

安装的一些过程,由于原始工程在不断更新,逐步加入了一些补丁包,有些步骤可能已经不再需要。

#!/bin/bash

#Need to install proper packages first ( although I might missed something ):
sudo port install git gsed gawk binutils gperf grep gettext py-serial

#Then create case sensitive volume ( like described by @tralamazza):
hdiutil create -size 10g -fs "Case-sensitive HFS+" -volname ESPTools ESPTools.sparsebundle
hdiutil attach ESPTools.sparsebundle
cd /Volumes/ESPTools

#Get the compiler:
git clone   --recursive 
cd esp-open-sdk
git submodule init
git submodule update
cd ..

#Patch it:
sed -i.bak '1s/^/gettext=\'$'\n/' crosstool-NG/kconfig/Makefile
sed -i.bak -e 's/[[:<:]]sed[[:>:]]/gsed/' Makefile
sed -i.bak -e 's/[[:<:]]awk[[:>:]]/\$(AWK)/' lx106-hal/src/Makefile.am
#上面两行执行出错,有谁知道原因?

sed -i.bak 's/AM_PROG_AS/AM_PROG_AS\'$'\nAM_PROG_AR/' configure.ac

#And finally build:
cd esp-open-sdk
make STANDALONE=n
#...n or y

设置路径:

sudo ln -s /Volumes/ESPTools/ /esptools
export PATH=$PATH:/esptools/esp-open-sdk/xtensa-lx106-elf/bin
cd /esptools/esp-open-sdk
git clone https://github.com/tuanpmt/esptool-ck.git
cd esptool-ck
make
chmod +x esptool

Compile esp-mqtt:

cd /esptools
git clone https://github.com/tuanpmt/esp_mqttcd esp_mqtt
make -f Makefile.mac

Compile NodeMcu:

git clone https://github.com/nodemcu/nodemcu-firmware
make

为了平时使用方便,每次进入系统需要运行(可以保存为.sh或放到启动脚本中,PATH在~/.profile中设置):

hdiutil attach ESPTools.sparsebundle
sudo ln -s /Volumes/ESPTools/ /esptools
export PATH=$PATH:/esptools/esp-open-sdk/xtensa-lx106-elf/bin

到此,相信大家对“esp-open-sdk在mac os x上的安装步骤”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

esp
AI