当前位置: 首页 > news >正文

【ESP32之旅】ESP32 PlatformIO 固件单独烧录

背景

有时候使用PIO编写的代码需要发给客户去验证,相比较于发送源码直接发送bin文件,更加的安全而且高效。不用担心源码的泄漏,也不用帮客户配置PIO环境。

操作方法

1.编译

首先进行代码编译,如编译成功会在 .pio\build\airm2m_core_esp32c3目录下生成对应的编译产物

在这里插入图片描述

2.准备对应产物文件

编译生成的产物如下图所示,其实还缺少一个boot_app0.bin的二级boot跳转文件,此文件在esp32 sdk的安装目录下。小编的在如下所示路径中。可以参考此目录在自己电脑上找下:

C:\Users\songz\.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin

在这里插入图片描述

3.烧录

首先使用PIO进行一次烧录,查看下每个bin文件对应的地址分布,相应的地址分布如下图所示:

在这里插入图片描述

产物名烧录地址
bootloader.bin0x00000000
partitions.bin0x00008000
boot_app0.bin0x0000e000
firmware.bin0x00010000

然后使用ESP32 Download tool进行烧录(Flash下载工具|乐鑫科技 (espressif.com))

在这里插入图片描述

后记

可能有的读者会好奇我是如何知道上面地址和产物的对应关系的,这是因为PIO烧录ESP32 归根结底也是依赖于ESP tool进行下载的,只是PIO隐藏了烧录过程中关于烧录产物和地址的相关输出,可以直接使用下面的命令在PIO终端中进行一次烧录即可看到相关的信息。

pio run -v -t upload

在这里插入图片描述

完整的日志如下:

PS E:\work\ESP32_BLE_Exit\ESP32_BLE_EXTI> pio run -v -t upload
Processing airm2m_core_esp32c3 (platform: espressif32; board: airm2m_core_esp32c3; framework: arduino; upload_speed: 1152000; upload_port: COM116; monitor_speed: 
115200; monitor_port: COM116)
------------------------------------------------------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/airm2m_core_esp32c3.html
PLATFORM: Espressif 32 (6.0.1) > AirM2M CORE ESP32C3
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:- framework-arduinoespressif32 @ 3.20006.221224 (2.0.6)- tool-esptoolpy @ 1.40400.0 (4.4.0)- tool-mkfatfs @ 2.0.1- tool-mklittlefs @ 1.203.210628 (2.3)- tool-mkspiffs @ 2.230.0 (2.30)- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP32 BLE Arduino @ 2.0.0 (License: Unknown, Path: C:\Users\songz\.platformio\packages\framework-arduinoespressif32\libraries\BLE)
Building in release mode
<lambda>(["checkprogsize"], [".pio\build\airm2m_core_esp32c3\firmware.elf"])
MethodWrapper(["checkprogsize"], [".pio\build\airm2m_core_esp32c3\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"       
RAM:   [=         ]  13.9% (used 45580 bytes from 327680 bytes)
Flash: [========= ]  87.2% (used 1143238 bytes from 1310720 bytes)
.pio\build\airm2m_core_esp32c3\firmware.elf  :section                    size         addr.rtc.text                    16   1342177280.rtc.force_fast               0   1342177296.rtc.data                    16   1342177296.rtc_noinit                   0   1342177312.rtc.force_slow               0   1342177312.iram0.text               63518   1077411840.dram0.dummy              64000   1070071808.dram0.data               13980   1070135808.noinit                       0   1070149788.dram0.bss                31600   1070149792.flash.text              879028   1107296288.flash_rodata_dummy      917504   1006632992.flash.appdesc              256   1007550496.flash.rodata            186712   1007550752.eh_frame                 81120   1007737464.flash.rodata_noload          0   1007818584.iram0.text_end             482   1077475358.iram0.data                   0   1077475840.iram0.bss                    0   1077475840.dram0.heap_start             0   1070181392.debug_info             9790248            0.debug_abbrev            704014            0.debug_loc              2036887            0.debug_aranges            89984            0.debug_ranges            246160            0.debug_line             3289982            0.debug_str              1500422            0.comment                     93            0.riscv.attributes            55            0.debug_frame             206320            0Total                  20102397
<lambda>(["upload"], [".pio\build\airm2m_core_esp32c3\firmware.bin"])
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
BeforeUpload(["upload"], [".pio\build\airm2m_core_esp32c3\firmware.bin"])
Using manually specified: COM116
"C:\Users\songz\.platformio\penv\Scripts\python.exe" "C:\Users\songz\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32c3 --port "COM116" --baud 1152000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0000 E:\work\ESP32_BLE_Exit\ESP32_BLE_EXTI\.pio\build\airm2m_core_esp32c3\bootloader.bin 0x8000 E:\work\ESP32_BLE_Exit\ESP32_BLE_EXTI\.pio\build\airm2m_core_esp32c3\partitions.bin 0xe000 C:\Users\songz\.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin 0x10000 .pio\build\airm2m_core_esp32c3\firmware.bin
esptool.py v4.4
Serial port COM116
Connecting....
Chip is ESP32-C3 (revision v0.3)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 60:55:f9:7b:b8:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 1152000
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00002fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0013bfff...
Compressed 12144 bytes to 8814...
Writing at 0x00000000... (100 %)
Wrote 12144 bytes (8814 compressed) at 0x00000000 in 0.2 seconds (effective 422.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 558.6 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 762.0 kbit/s)...
Hash of data verified.
Compressed 1224752 bytes to 637138...
Writing at 0x00010000... (2 %)
Writing at 0x0001bd8c... (5 %)
Writing at 0x00028c4b... (7 %)
Writing at 0x00035a14... (10 %)
Writing at 0x00042dc6... (12 %)
Writing at 0x00050725... (15 %)
Writing at 0x000581cf... (17 %)
Writing at 0x0005df3e... (20 %)
Writing at 0x0006417a... (23 %)
Writing at 0x0006adc0... (25 %)
Writing at 0x00071f47... (28 %)
Writing at 0x00077fc5... (30 %)
Writing at 0x0007ead3... (33 %)
Writing at 0x00085ea9... (35 %)
Writing at 0x0008c45c... (38 %)
Writing at 0x00092af1... (41 %)
Writing at 0x00098f5c... (43 %)
Writing at 0x0009ef42... (46 %)
Writing at 0x000a64ab... (48 %)
Writing at 0x000acd4d... (51 %)
Writing at 0x000b470b... (53 %)
Writing at 0x000baf62... (56 %)
Writing at 0x000c12bc... (58 %)
Writing at 0x000c8372... (61 %)
Writing at 0x000d0324... (64 %)
Writing at 0x000d881c... (66 %)
Writing at 0x000df2c9... (69 %)
Writing at 0x000e5bb3... (71 %)
Writing at 0x000ec6da... (74 %)
Writing at 0x000f2bdb... (76 %)
Writing at 0x000f8997... (79 %)
Writing at 0x000ff7c3... (82 %)
Writing at 0x001078f4... (84 %)
Writing at 0x0010fb59... (87 %)
Writing at 0x0011a658... (89 %)
Writing at 0x001209b6... (92 %)
Writing at 0x001270c7... (94 %)
Writing at 0x0012e3e9... (97 %)
Writing at 0x001359f6... (100 %)
Wrote 1224752 bytes (637138 compressed) at 0x00010000 in 17.1 seconds (effective 572.2 kbit/s)...
Hash of data verified.Leaving...
Hard resetting via RTS pin...
================================================================== [SUCCESS] Took 24.93 seconds ==================================================================

相关文章:

【ESP32之旅】ESP32 PlatformIO 固件单独烧录

背景 有时候使用PIO编写的代码需要发给客户去验证&#xff0c;相比较于发送源码直接发送bin文件&#xff0c;更加的安全而且高效。不用担心源码的泄漏&#xff0c;也不用帮客户配置PIO环境。 操作方法 1.编译 首先进行代码编译&#xff0c;如编译成功会在 .pio\build\airm2…...

视频监控业务平台LntonCVS运用国标协议对接视频汇聚管理综合平台应用方案

为了实现“以信息化推动应急管理能力现代化”的目标&#xff0c;应急管理部提出了加速现代信息技术与应急管理业务深度融合的计划。这一计划是国家加强和改进应急管理工作的关键举措&#xff0c;也是满足日益严峻的应急管理形势和人民群众不断增长的公共安全需求的紧迫需求。 为…...

【Linux 网络编程】协议的分层知识!

文章目录 1. 计算机网络背景2. 认识 "协议"3. 协议分层 1. 计算机网络背景 网络互联: 多台计算机连接在一起, 完成数据共享; &#x1f34e;局域网&#xff08;LAN----Local Area Network&#xff09;: 计算机数量更多了, 通过交换机和路由器连接。 &#x1f34e; 广…...

Firefox国际版

Firefox国际版官方网址&#xff1a; Download the Firefox Browser in English (US) and more than 90 other languagesEveryone deserves access to the internet — your language should never be a barrier. That’s why — with the help of dedicated volunteers around…...

封装和解构是 Python 中常用的技术

目录 前言 一、封装&#xff08;Packing&#xff09;&#xff1a; 二、解构&#xff08;Unpacking&#xff09;&#xff1a; 2.1 解构元组或列表&#xff1a; 2.2 解构字典&#xff1a; 2.3 使用*进行解构&#xff1a; 2.4 解构函数返回值 总结 前言 提示&#xff1a;这…...

理解OAuth:服务间的授权机制

理解OAuth:服务间的授权机制 好的,让我来教你一下关于这个奇怪的东西。 在不同的项目中,认证有很多不同的方式。但在我们深入探讨它的使用方式之前,让我们先来看看它最初的用途。 首先,我们可以从名称中得到一些线索。“auth”这个词与什么有关呢?问题是,这里的“aut…...

JRT性能演示

演示视频 君生我未生&#xff0c;我生君已老&#xff0c;这里是java信创频道JRT&#xff0c;真信创-不糊弄。 基础架构决定上层建筑&#xff0c;和给有些品种的植物种植一样&#xff0c;品种不对&#xff0c;施肥浇水再多&#xff0c;也是不可能长成参天大树的。JRT吸收了各方…...

React 使用JSX或者TSX渲染页面

02 Rendering with JSX Your first JSX content In this section, we’ll implement the obligatory " Hello, World " JSX application. At this point, we’re just dipping our toes in the water; more in-depth examples will follow. We’ll also discuss wh…...

【Linux】Socket中的心跳机制(心跳包)

Socket中的心跳机制(心跳包) 1. 什么是心跳机制&#xff1f;(心跳包) 在客户端和服务端长时间没有相互发送数据的情况下&#xff0c;我们需要一种机制来判断连接是否依然存在。直接发送任何数据包可以实现这一点&#xff0c;但为了效率和简洁&#xff0c;通常发送一个空包&am…...

Java怎样动态给对象添加属性并赋值【代码实现】

本篇文章主要介绍Java如何给已有实体类动态的添加字段并返回新的实体对象且不影响原来的实体对象结构。 参考代码如下&#xff1a; 引入依赖包 <dependency><groupId>cglib</groupId><artifactId>cglib</artifactId><version>2.2.2</…...

C#多线程同步lock、Mutex

C#使用多线程可以通过System.Threading命名空间下的Thread类来实现 lock和Mutex用于实现线程同步的机制&#xff1a; 上代码&#xff1a; class People{public People(int idd){id idd;}public int id;public int age;}class TestHelper{public TestHelper() { }List<Peo…...

模型实战(21)之 C++ - tensorRT部署yolov8-det 目标检测

C++ - tensorRT部署yolov8-det 目标检测 python环境下如何直接调用推理模型转换并导出:pt -> onnx ->.engineC++ tensorrt 部署检测模型不写废话了,直接上具体实现过程+all代码 1.Python环境下推理 直接命令行推理,巨简单yolo detect predict model=yolov8n.pt source…...

Linux完整版命令大全(二十一)

mkswap 功能说明&#xff1a;设置交换区(swap area)。语  法&#xff1a;mkswap [-cf][-v0][-v1][设备名称或文件][交换区大小]补充说明&#xff1a;mkswap可将磁盘分区或文件设为Linux的交换区。参  数&#xff1a; -c 建立交换区前&#xff0c;先检查是否有损坏的区…...

Elasticsearch集群许可证过期问题解决方法汇总

最近在使用elasticsearch的过程中,使用elastic-head进行可视化展示集群的状态和信息,从2024年5月18日突然elastic-head无法现在集群的状态界面啦,elasticsearch集群状态是正常,命令如下: curl -X GET "localhost:9200/_cluster/health?pretty" 在google页面上通过…...

Golang实现根据文件后缀删除文件和递归删除文件

概述 这个功能会非常强大&#xff0c;因为在日常工作中&#xff0c;我通常会遇到需要批量删除文件的场景&#xff0c;通过这个方法&#xff0c;再结合我的另一个 命令行开发框架&#xff0c;能够很轻松的开发出这个功能。 代码 package zdpgo_fileimport ("errors"…...

Python OCR 文字识别使用模型:读光-文字识别-行识别模型-中英-通用领域

介绍 什么是OCR&#xff1f; OCR是“Optical Character Recognition”的缩写&#xff0c;中文意为“光学字符识别”。它是一种技术&#xff0c;可以识别和转换打印在纸张或图像上的文字和字符为机器可处理的格式&#xff0c;如计算机文本文件。通过使用OCR技术&#xff0c;可…...

Python | Leetcode Python题解之第105题从前序与中序遍历序列构造二叉树

题目&#xff1a; 题解&#xff1a; class Solution:def buildTree(self, preorder: List[int], inorder: List[int]) -> TreeNode:if not preorder:return Noneroot TreeNode(preorder[0])stack [root]inorderIndex 0for i in range(1, len(preorder)):preorderVal pr…...

经典面试题:什么是事物的隔离级别?什么是MVCC?

目录 前言一、事物的隔离级别二、隔离级别是如何实现的1. 锁定技术2. 多版本并发控制&#xff08;MVCC&#xff09;基本原理实现机制优缺点 3. 乐观锁与悲观锁 三、MySQL设置隔离级别MySQL数据库Java (使用JDBC) 前言 事务的四大特性&#xff08;ACID特性&#xff09;&#xf…...

Java程序中,不同jar包,有2个完全相同的类,运行时的加载顺序

在Java程序中&#xff0c;如果有两个完全相同的类存在于不同的jar包中&#xff0c;那么在运行时究竟加载哪个类&#xff0c;主要取决于类加载器的类路径&#xff08;Classpath&#xff09;搜索顺序。 Java使用类加载器&#xff08;ClassLoader&#xff09;来动态加载类。当Jav…...

EI期刊的定金和尾款

当涉及到EI&#xff08;工程索引&#xff09;期刊发表并支付定金和尾款时&#xff0c;许多学者和研究人员可能会感到担忧&#xff0c;因为这涉及到一定的风险。在探讨这个话题时&#xff0c;我们需要考虑几个因素&#xff0c;包括期刊的声誉、可信度、出版质量以及作者的权益保…...

python+pytest+pytest-html+allure集成测试案例

pythonpytestpytest-htmlallure集成测试案例 下面是pythonpytestpytest-htmlallure四个组件同时集成使用的简单案例。 1. 项目结构 project/ │ ├── src/ │ ├── __init__.py │ ├── main.py │ ├── tests/ │ ├── __init__.py │ ├── conftest.p…...

STL-priority_queue的使用及其模拟实现

优先级队列(priority_queue)默认使用vector作为其底层存储数据的容器&#xff0c;在vector上又使用了堆算法将vector中的元素构造成堆的结构&#xff0c;因此priority_queue就是堆&#xff0c;所有需要用到堆的位置&#xff0c;都可以考虑使用priority_queue。 注意&#xff1…...

pycharm连接阿里云服务器过程记录

因为不想用自己的电脑安装anaconda环境,所以去查了一下怎么用服务器跑代码,试着用pycharm连接阿里云服务器,参考了很多博客,自己简单配置了一下,记录一下目前完成的流程. 主要是:阿里云服务器的远程登录和安装anaconda,以及怎么用pycharm连接阿里云服务器上的解释器. 小白刚开始…...

移动硬盘未格式化数据恢复及预防策略

随着数字化时代的到来&#xff0c;移动硬盘作为数据存储的重要载体&#xff0c;被广泛应用于个人和企业中。然而&#xff0c;当移动硬盘遭遇“未格式化”的困境时&#xff0c;其中的数据便岌岌可危。本文将深入探讨移动硬盘未格式化的现象、原因、数据恢复方案以及预防措施&…...

MySQL数据库入门之视图、存储过程、触发器

一、视图&#xff1a; 1.1、视图是什么&#xff1f;怎么理解&#xff1f; 视图是从数据库的基本表&#xff08;或者视图&#xff09;导出的虚表&#xff08;数据库只放定义&#xff0c;它不实际存储数据&#xff0c;而是根据用户定义的SQL查询动态生成的结果集&#xff0c;具…...

Kafka原生API使用Java代码-生产者-分区策略-默认分区策略轮询分区策略

文章目录 1、代码演示1.1、pom.xml1.2、KafkaProducerPartitioningStrategy.java1.2.1、ProducerConfig.LINGER_MS_CONFIG取 0 值得情况&#xff0c;不轮询1.2.2、ProducerConfig.LINGER_MS_CONFIG取 0 值得情况&#xff0c;轮询1.2.3、ProducerConfig.LINGER_MS_CONFIG取 1000…...

网页中的音视频裁剪拼接合并

一、需求描述 项目中有一个配音需求&#xff1a; 1&#xff09;首先&#xff0c;前台会拿到一个英语视频&#xff0c;视频的内容是A和B用英语交流&#xff1b; 2&#xff09;然后&#xff0c;用户可以选择为某一个角色配音&#xff0c;假如选择为A配音&#xff0c;那么视频在播…...

【入门】使用sklearn实现的KNN算法:鸢尾花数据集分类预测

目录 前言 第一步&#xff1a;安装和导入sklean模块 第二步&#xff1a;获取数据 第二步&#xff1a;分割出训练集和测试集 第三步&#xff1a;训练模型 第四步&#xff1a;测试结果 总结 前言 本文将介绍如何利用K最近邻&#xff08;KNN&#xff09;算法对经典的鸢尾花数…...

nss做题

[NCTF 2018]签到题 1.f12在index.php中找到flag [NSSCTF 2022 Spring Recruit]ezgame 1.在js源码中就有flag [UUCTF 2022 新生赛]websign 1.打开环境后发现ctrlu和右键&#xff0c;f12都被禁用了。两种方法&#xff0c;第一种&#xff1a;禁用js&#xff1b;第二中提前打开…...

​第18章:JDK8-17新特性

1. 新特性概述 > 角度1&#xff1a;新的语法规则 &#xff08;多关注&#xff09;比如&#xff1a;lambda表达式、enum、annotation、自动拆箱装箱、接口中的默认方法和静态方法、switch表达式、record等> 角度2&#xff1a;增加、过时、删除API比如&#xff1a;新的日期…...