提要:针对于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.

转载于:https://www.cnblogs.com/mfc1207/p/8743384.html

基于Ubuntu的ESP32平台搭建相关推荐

  1. Re.从零开始--基于UbuntuServer 20.04-OpenStack平台搭建_

    基于UbuntuServer 20.04-OpenStack平台搭建_ 前言: 本文档基于ubuntu-server20.04版本和OpenStack Victoria搭建openstack环境 部署 ...

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

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

  3. 基于OpenStack的云计算平台搭建

    文章目录 1.硬件需求(所有节点) 1.1.配置需求 1.2.IP&主机&配置 2.安装基础环境&服务(控制节点) 2.1.安装 NTP 时间同步服务 - - 目录 基于Ope ...

  4. 基于hisilicon的arm平台搭建gdb+gdbserver调试环境

    这段时间搭建了一个基于hisilicon的arm平台搭建gdb+gdbserver调试环境,网上对hisilicon平台的搭建资料不多,基本上是arm-linux-gdb的,而没有arm-uclibc ...

  5. 基于Hadoop的数据分析平台搭建

    企业发展到一定规模都会搭建单独的BI平台来做数据分析,即OLAP(联机分析处理),一般都是基于数据库技术来构建,基本都是单机产品.除了业务数据的相关分析外,互联网企业还会对用户行为进行分析,进一步挖掘 ...

  6. 基于CentOs7的moodle平台搭建历程

    当初接手这个事,还是比较头疼的,大二而已,从来没接触过服务器搭建,没接触过moodle,毫无头绪,只能一点点百度,无奈总是感觉没有一篇很完整的,于是在自己搭建完后的欣喜之余,空出时间写了这篇文章,若有 ...

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

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

  8. 基于Ubuntu环境使用docker搭建对于中文识别的chineseocr_lite项目

    光学字符识别(OCR) 光学字符识别(OCR)目前已经有了很广泛的应用,很多开源项目都会嵌入OCR 来扩展原有的能力,例如身份证识别.出入停车场的车牌识别.拍照翻译等等 本文介绍的开源的中文 OCR ...

  9. 从零开始Ubuntu下xss平台搭建的完整教程

    0x01 环境搭建 apache安装 在ubuntu下安装apache2很简单,只要用apt-get install apache2就可以了,安装完成后,在 /etc/apache2/路径下,有个ap ...

  10. 基于Ubuntu的esp32编程学习(https://www.bilibili.com/video/BV1wV4y1G7Vk?p=22vd_source=c89885f80e65caacb539e)

    使用vscode远程连接虚拟机 1.使用git sudo apt install git 安装git git config --global user.email "XXX.com" ...

最新文章

  1. OpenResty 最佳实践
  2. python从入门到实践15章的几个自己的小程序
  3. input两种默认显示文字方式
  4. C#5 复习总结循环 迭代和穷举
  5. rcnn代码实现_Faster-RCNN论文细节原理解读+代码实现gluoncv(MXNet)
  6. 返回一个二维整数数组最大联通子数组的和(思路)
  7. Oracle 11g RAC 修改IP
  8. 二分法08:寻找旋转排序数组中的最小值
  9. JQuery的一些简单使用
  10. Linux USB总线驱动框架分析
  11. 5.ESL笔记:线性模型与高斯-马尔科夫定理
  12. Android实验五-组件通信2
  13. 宝塔+云锁nginx自编译web防护 防御CC效果极佳
  14. 二叉查找树(BST)专题
  15. 个人家用nas_方便易用的家用NAS私家云不超千元
  16. 司马谈《论六家要旨》品读
  17. 浙江大学求是科学班计算机,2018年浙江大学求是科学班(生物科学)招生简章...
  18. iOS 删除 SceneDelegeta.h
  19. 绅士福利:Python秒爬取全网美女写真
  20. Linux RCU锁简析

热门文章

  1. Python(七):输入输出(IO)、文件读写
  2. Java线程输出字母大小写_FastJson 输出值 首字母大小写问题
  3. bat打包成exe_拜托!看完这篇文章别再问我怎么Python打包成exe了!
  4. unity api中文手册_unity 中文API之Display
  5. pythonscrapy爬虫_使用Python3和Scrapy进行网站图片爬虫自动下载
  6. 牛客网OI题:序列划分
  7. c语言串口接收的字符转int,从串口发送和接收int值
  8. 极客大学架构师训练营--编程的未来 面向对象 依赖倒置原则 -- 第二次作业
  9. 算法:回溯十七 Combination Sum III挑选数组中规定个数元素的和为指定数
  10. 证明一个距离空间是完备的