提要:针对于Ubuntu下的ESP32搭建,网上有很多博文,乐鑫官网也有指导手册,对于到家都知道的部分我就一带而过,我主要描述搭建过程中遇到的问题和细节。

1.创建一个ESP的目录

I)在家目录下创建个ESP文件夹(当然你也可以不在家目录下创建,甚至不创建,只有你找得你的操作目录就行)

mkdir  /home/tom/esp     (note:tom是我的用户名)

II)切换到ESP目录下

cd ~/esp

2.工具链设置

I)先下载python支持库

sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial

II)下载工具链

for 64-bit Linux:

https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz

for 32-bit Linux:

https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-75-gbaf03c2-5.2.0.tar.gz

我的用的是64bitLinux,下载以后的文件是这样的

III)将工具链解压到esp文件目录下

tar -xzf  ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz

IV)将esp工具链写入环境变量PATH中。

在~/.profile文件中写入:

export PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin"

V)重新读取PATH环境变量

source  ~/.profile

printenv PATH

若是可以看到esp工具链的目录,则表示工具链设置成功了!

3.下载ESP-IDF(也就是乐鑫提供的SDK)

I)下载SDK

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

II)添加IDF_PATH环境变量

在 ~/.profile文件添加:

export IDF_PATH=~/esp/esp-idf

加载~/.profile文件:

Source ~/.profile

检查IDF_PATH

printenv IDF_PATH

如果打印出IDF_PATH的目录的话,则表示添加成功

4)开始一个工程

I)在SDK中拷贝一个Demo到esp文件夹下

cp -r $IDF_PATH/examples/get-started/hello_world .

II)设置参数

执行 make menuconfig,会出现以下界面:(置于具体参数的含义,请自行了解)

III)编译与运行

在确保硬件连接无误的情况下,执行 make flash,程序将要编译,若编译没有错误,将直接下载到Flash中,出现以下界面,表示程序已经正常运行。

note:提供一些make 指令集,可供开发使用

Welcome to Espressif IDF build system. Some useful make targets:

make menuconfig - Configure IDF project

make defconfig - Set defaults for all new configuration options

make all - Build app, bootloader, partition table

make flash - Flash app, bootloader, partition table to a chip

make clean - Remove all build output

make size - Display the static memory footprint of the app

make size-components, size-files - Finer-grained memory footprints

make erase_flash - Erase entire flash contents

make monitor - Run idf_monitor tool to monitor serial output from app

make simple_monitor - Monitor serial output on terminal console

make list-components - List all components in the project

make app - Build just the app

make app-flash - Flash just the app

make app-clean - Clean just the app

make print_flash_cmd - Print the arguments for esptool when flash

See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean',

'make partition_table', etc, etc.ls

* 5)更新ESP-IDF(这阶段本人并未实践,以下内容来自乐鑫官网)

After some time of using ESP-IDF, you may want to update it to take advantage of new features or bug fixes. The simplest way to do so is by deleting existing esp-idffolder and cloning it again, exactly as when doing initial installation described in sections Get ESP-IDF.

Another solution is to update only what has changed. This method is useful if you have slow connection to the GiHub. To do the update run the following commands:

cd ~/esp/esp-idf

git pull

git submodule update --init --recursive

The git pull command is fetching and merging changes from ESP-IDF repository on GitHub. Then git submodule update --init --recursive is updating existing submodules or getting a fresh copy of new ones. On GitHub the submodules are represented as links to other repositories and require this additional command to get them onto your PC.

If you would like to use specific release of ESP-IDF, e.g. v2.1, run:

cd ~/esp

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

cd esp-idf-v2.1/

git checkout v2.1

git submodule update --init --recursive

After that remember to Add IDF_PATH to User Profile, so the toolchain scripts know where to find the ESP-IDF in it’s release specific location.

基于Ubuntu的ESP32平台搭建的更多相关文章

  1. 基于认证的代理平台搭建配置squid-20130730

    基于认证的代理平台搭建配置squid-20130730 功能:通过squid代理实现 (1)基于用户名密码认证的出口ip路由选择 (2)基于client源ip的出口ip路由选择 (3)基于连接本机ip ...

  2. 基于locust的性能测试平台搭建

    前段时间加入性能测试组,并参与搭建基于locust的性能测试平台,我分到的任务相对独立,开发locust的启动接口和停止运行接口,现开发的差不多了,做一个总结 一.locust运行的相关内容 二.lo ...

  3. 基于Ubuntu Hadoop的群集搭建Hive

    Hive是Hadoop生态中的一个重要组成部分,主要用于数据仓库.前面的文章中我们已经搭建好了Hadoop的群集,下面我们在这个群集上再搭建Hive的群集. 1.安装MySQL 1.1安装MySQL ...

  4. 基于Docker在Win10平台搭建Ruby on Rails 6.0框架开发环境

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_170 2020年,"非著名Web框架"–Ruby on Rails已经15岁了.在今年,Rails 6.0趋于 ...

  5. 基于Ubuntu的LNMP环境搭建

    装备的工具 Ubuntu16.04 , Xshell 使用Xshell链接到Ubuntu 使用xshell链接Ubuntu不是必须的,只是为了操作的方便,同时默认是你的Ubuntu已经安装好了 在Ub ...

  6. 腾讯云:基于 Ubuntu 搭建 VNC 远程桌面服务

    基于 Ubuntu 搭建 VNC 远程桌面服务 前言 任务时间:5min ~ 10min 必要知识 本教程假设您已学习以下 Ubuntu 基本操作: 连接 SSH 执行命令 编辑文件 如果还没有掌握 ...

  7. 基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境

    基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境 前言一.环境准备环境介绍软件下载VMware下安装UbuntuUbuntu下Anaconda的安 ...

  8. 基于Moodle的IT课程辅助教育平台搭建

    基于Moodle的IT课程辅助教育平台搭建 Moodle是一个开源课程管理系统(CMS),也被称为学习管理系统(LMS)或虚拟学习环境(VLE).它已成为深受世界各地教育工作者喜爱的一种为学生建立网上 ...

  9. 基于MyEclipse+9.0+++Tomcat+7.0的SSH+平台搭建

    基于MyEclipse+9.0+++Tomcat+7.0的SSH+平台搭建 http://wenku.baidu.com/view/96fbfe0f581b6bd97f19ea1d.html 用MyE ...

随机推荐

  1. 剑指offer 11. 位运算 二进制中1的个数

    题目描述 输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示.   //思想:用1(1自身左移运算,其实后来就不是1了)和n的每位进行位与,来判断1的个数     private stat ...

  2. pycrypto安装出错的问题 intmax_t C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\inttypes.

    前言: 需要安装 Microsoft Visual Studio2017 Community 或者buildtools 解决方案一(解决了python3.7上安装pycrypto-2.6.1的错误问题 ...

  3. OpenCV中feature2D——BFMatcher和FlannBasedMatcher

    作者:holybin 原文:https://blog.csdn.net/holybin/article/details/40926315 Brute Force匹配和FLANN匹配是opencv二维特 ...

  4. USB协议学习

    URB:USB 请求块(USB request block,urb)是USB 设备驱动中用来描述与USB 设备通信所用的基本载体和核心数据结构,非常类似于网络设备驱动中的sk_buff 结构体.

  5. React 思维索引

    关于分析React源码的文章已经有比较多,我就不献丑了. 根据分析的结果把React的大致流程和思维导图做了一点总结,图片如下: 源码在: https://github.com/laryosbert/ ...

  6. 使用Excel自动生成sql语句

    在近一段日子里,进入了新的项目组,由于项目需要,经常要将一些Excel表中的数据导入数据库中,以前并没有过多的接触过数据导入与数据处理,对于我来说比较痛苦,今天下午花了几个小时处理数据,但是同事给我提 ...

  7. no module named selenium

    I am having the same problem. I have downgraded selenium for now. pip uninstall selenium pip install ...

  8. 软件职位进阶--立Flag

    PS:是我从看过的书籍<软件测试进阶之路>上摘录的 很喜欢:深耕细作一词,可以走管理leader方向,但我更愿意是技术掌握到手后,兼职管理岗位. 庆幸吧,脚踏实地,没有上来就学自动化,所以 ...

  9. Android 开发 蓝牙开发

    前言 蓝牙开发其实分2个部分,一个是正常蓝牙功能的开发(比如Android蓝牙的互相连接.读取蓝牙列表.文件传输.蓝牙耳机等等).另外一个是BLE蓝牙开发(属于低功耗蓝牙设备,设备大多是血糖仪.蓝牙手 ...

  10. Linux如何查看端口

    Linux如何查看端口 1.lsof -i:端口号 用于查看某一端口的占用情况,比如查看8000端口使用情况,lsof -i:8000 # lsof -i:8000 COMMAND PID USER ...