【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.bin | 0x00000000 |
partitions.bin | 0x00008000 |
boot_app0.bin | 0x0000e000 |
firmware.bin | 0x00010000 |
然后使用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编写的代码需要发给客户去验证,相比较于发送源码直接发送bin文件,更加的安全而且高效。不用担心源码的泄漏,也不用帮客户配置PIO环境。 操作方法 1.编译 首先进行代码编译,如编译成功会在 .pio\build\airm2…...

视频监控业务平台LntonCVS运用国标协议对接视频汇聚管理综合平台应用方案
为了实现“以信息化推动应急管理能力现代化”的目标,应急管理部提出了加速现代信息技术与应急管理业务深度融合的计划。这一计划是国家加强和改进应急管理工作的关键举措,也是满足日益严峻的应急管理形势和人民群众不断增长的公共安全需求的紧迫需求。 为…...

【Linux 网络编程】协议的分层知识!
文章目录 1. 计算机网络背景2. 认识 "协议"3. 协议分层 1. 计算机网络背景 网络互联: 多台计算机连接在一起, 完成数据共享; 🍎局域网(LAN----Local Area Network): 计算机数量更多了, 通过交换机和路由器连接。 🍎 广…...

Firefox国际版
Firefox国际版官方网址: 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 中常用的技术
目录 前言 一、封装(Packing): 二、解构(Unpacking): 2.1 解构元组或列表: 2.2 解构字典: 2.3 使用*进行解构: 2.4 解构函数返回值 总结 前言 提示:这…...
理解OAuth:服务间的授权机制
理解OAuth:服务间的授权机制 好的,让我来教你一下关于这个奇怪的东西。 在不同的项目中,认证有很多不同的方式。但在我们深入探讨它的使用方式之前,让我们先来看看它最初的用途。 首先,我们可以从名称中得到一些线索。“auth”这个词与什么有关呢?问题是,这里的“aut…...

JRT性能演示
演示视频 君生我未生,我生君已老,这里是java信创频道JRT,真信创-不糊弄。 基础架构决定上层建筑,和给有些品种的植物种植一样,品种不对,施肥浇水再多,也是不可能长成参天大树的。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. 什么是心跳机制?(心跳包) 在客户端和服务端长时间没有相互发送数据的情况下,我们需要一种机制来判断连接是否依然存在。直接发送任何数据包可以实现这一点,但为了效率和简洁,通常发送一个空包&am…...
Java怎样动态给对象添加属性并赋值【代码实现】
本篇文章主要介绍Java如何给已有实体类动态的添加字段并返回新的实体对象且不影响原来的实体对象结构。 参考代码如下: 引入依赖包 <dependency><groupId>cglib</groupId><artifactId>cglib</artifactId><version>2.2.2</…...

C#多线程同步lock、Mutex
C#使用多线程可以通过System.Threading命名空间下的Thread类来实现 lock和Mutex用于实现线程同步的机制: 上代码: 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 功能说明:设置交换区(swap area)。语 法:mkswap [-cf][-v0][-v1][设备名称或文件][交换区大小]补充说明:mkswap可将磁盘分区或文件设为Linux的交换区。参 数: -c 建立交换区前,先检查是否有损坏的区…...

Elasticsearch集群许可证过期问题解决方法汇总
最近在使用elasticsearch的过程中,使用elastic-head进行可视化展示集群的状态和信息,从2024年5月18日突然elastic-head无法现在集群的状态界面啦,elasticsearch集群状态是正常,命令如下: curl -X GET "localhost:9200/_cluster/health?pretty" 在google页面上通过…...
Golang实现根据文件后缀删除文件和递归删除文件
概述 这个功能会非常强大,因为在日常工作中,我通常会遇到需要批量删除文件的场景,通过这个方法,再结合我的另一个 命令行开发框架,能够很轻松的开发出这个功能。 代码 package zdpgo_fileimport ("errors"…...

Python OCR 文字识别使用模型:读光-文字识别-行识别模型-中英-通用领域
介绍 什么是OCR? OCR是“Optical Character Recognition”的缩写,中文意为“光学字符识别”。它是一种技术,可以识别和转换打印在纸张或图像上的文字和字符为机器可处理的格式,如计算机文本文件。通过使用OCR技术,可…...

Python | Leetcode Python题解之第105题从前序与中序遍历序列构造二叉树
题目: 题解: 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. 多版本并发控制(MVCC)基本原理实现机制优缺点 3. 乐观锁与悲观锁 三、MySQL设置隔离级别MySQL数据库Java (使用JDBC) 前言 事务的四大特性(ACID特性)…...
Java程序中,不同jar包,有2个完全相同的类,运行时的加载顺序
在Java程序中,如果有两个完全相同的类存在于不同的jar包中,那么在运行时究竟加载哪个类,主要取决于类加载器的类路径(Classpath)搜索顺序。 Java使用类加载器(ClassLoader)来动态加载类。当Jav…...

EI期刊的定金和尾款
当涉及到EI(工程索引)期刊发表并支付定金和尾款时,许多学者和研究人员可能会感到担忧,因为这涉及到一定的风险。在探讨这个话题时,我们需要考虑几个因素,包括期刊的声誉、可信度、出版质量以及作者的权益保…...
浅谈 React Hooks
React Hooks 是 React 16.8 引入的一组 API,用于在函数组件中使用 state 和其他 React 特性(例如生命周期方法、context 等)。Hooks 通过简洁的函数接口,解决了状态与 UI 的高度解耦,通过函数式编程范式实现更灵活 Rea…...

智慧工地云平台源码,基于微服务架构+Java+Spring Cloud +UniApp +MySql
智慧工地管理云平台系统,智慧工地全套源码,java版智慧工地源码,支持PC端、大屏端、移动端。 智慧工地聚焦建筑行业的市场需求,提供“平台网络终端”的整体解决方案,提供劳务管理、视频管理、智能监测、绿色施工、安全管…...

基于Flask实现的医疗保险欺诈识别监测模型
基于Flask实现的医疗保险欺诈识别监测模型 项目截图 项目简介 社会医疗保险是国家通过立法形式强制实施,由雇主和个人按一定比例缴纳保险费,建立社会医疗保险基金,支付雇员医疗费用的一种医疗保险制度, 它是促进社会文明和进步的…...
ffmpeg(四):滤镜命令
FFmpeg 的滤镜命令是用于音视频处理中的强大工具,可以完成剪裁、缩放、加水印、调色、合成、旋转、模糊、叠加字幕等复杂的操作。其核心语法格式一般如下: ffmpeg -i input.mp4 -vf "滤镜参数" output.mp4或者带音频滤镜: ffmpeg…...

uniapp微信小程序视频实时流+pc端预览方案
方案类型技术实现是否免费优点缺点适用场景延迟范围开发复杂度WebSocket图片帧定时拍照Base64传输✅ 完全免费无需服务器 纯前端实现高延迟高流量 帧率极低个人demo测试 超低频监控500ms-2s⭐⭐RTMP推流TRTC/即构SDK推流❌ 付费方案 (部分有免费额度&#x…...
三体问题详解
从物理学角度,三体问题之所以不稳定,是因为三个天体在万有引力作用下相互作用,形成一个非线性耦合系统。我们可以从牛顿经典力学出发,列出具体的运动方程,并说明为何这个系统本质上是混沌的,无法得到一般解…...
AI编程--插件对比分析:CodeRider、GitHub Copilot及其他
AI编程插件对比分析:CodeRider、GitHub Copilot及其他 随着人工智能技术的快速发展,AI编程插件已成为提升开发者生产力的重要工具。CodeRider和GitHub Copilot作为市场上的领先者,分别以其独特的特性和生态系统吸引了大量开发者。本文将从功…...
【JavaSE】绘图与事件入门学习笔记
-Java绘图坐标体系 坐标体系-介绍 坐标原点位于左上角,以像素为单位。 在Java坐标系中,第一个是x坐标,表示当前位置为水平方向,距离坐标原点x个像素;第二个是y坐标,表示当前位置为垂直方向,距离坐标原点y个像素。 坐标体系-像素 …...

项目部署到Linux上时遇到的错误(Redis,MySQL,无法正确连接,地址占用问题)
Redis无法正确连接 在运行jar包时出现了这样的错误 查询得知问题核心在于Redis连接失败,具体原因是客户端发送了密码认证请求,但Redis服务器未设置密码 1.为Redis设置密码(匹配客户端配置) 步骤: 1).修…...

Chrome 浏览器前端与客户端双向通信实战
Chrome 前端(即页面 JS / Web UI)与客户端(C 后端)的交互机制,是 Chromium 架构中非常核心的一环。下面我将按常见场景,从通道、流程、技术栈几个角度做一套完整的分析,特别适合你这种在分析和改…...