ToB企服应用市场:ToB评测及商务社交产业平台

标题: 基于 ESP32-C3 开启 Flash 加密和安全启动并举行 OTA 测试 [打印本页]

作者: 大连密封材料    时间: 2024-10-20 14:56
标题: 基于 ESP32-C3 开启 Flash 加密和安全启动并举行 OTA 测试
软件:


硬件:



1. 首先,预备一个明文固件hello-world.bin


idf.py set-target esp32c3
idf.py build
2. **接下来,基于[esp-

idf-v5.1.2\examples\system\ota\simple_ota_example](https://github.com/espressif/esp-
idf/tree/v5.1.2/examples/system/ota/simple_ota_example) 例程举行测试**

![在这里插入图片形貌](https://img-
blog.csdnimg.cn/direct/7729fe7fc24d4de1a8849e77fe116ce0.png)
3. 利用如下指令获取secure boot V2 key

  1. espsecure.py generate_signing_key secure_boot_signing_key.pem --version 2
复制代码
4. **利用如下指令,通过生成的secure_boot_signing_key.pem 文件对 明文的 `hello-

world.bin`
举行署名,生成被署名的 SIGNED_hello_world.bin**
  1. espsecure.py sign_data --version 2 --keyfile secure_boot_signing_key.pem --output SIGNED_hello_world.bin hello_world.bin
复制代码
![在这里插入图片形貌](https://img-
blog.csdnimg.cn/direct/0ca1fee8a443470c91f67e5bc44659a1.png)
5. **为了方便 OTA 测试,我们[在当地开启一个 HTTP Server

服务器](https://blog.csdn.net/weixin_42083266/article/details/134696145?spm=1001.2014.3001.5502),将署名的
SIGNED_hello_world.bin 上传到 HTTP Server 中**
![在这里插入图片形貌](https://img-
blog.csdnimg.cn/direct/366b2e0eeb7343c4879baf02d6375ae2.png)
6. **基于[esp-

idf-v5.1.2\examples\system\ota\simple_ota_example](https://github.com/espressif/esp-
idf/tree/v5.1.2/examples/system/ota/simple_ota_example) 例程,开启如下软件配置**

7. 利用如下指令编译bootloader ,并下载被署名的 bootloader.bin

  1. idf.py bootloader
  2. idf.py -p COM* boorloader-flash
复制代码
8. 利用如下指令,对工程举行编译,并下载编译后的固件

  1. idf.py build
  2. idf.py -p COM* flash monitor
复制代码
9. 查抄固件运行日志

   注意:确保稳固的供电环境
  
学习计划安排


我一共分别了六个阶段,但并不是说你得学完全部才能上手工作,对于一些初级岗位,学到第三四个阶段就足矣~
这里我整合而且整理成了一份【282G】的网络安全从零底子入门到进阶资料包,需要的小同伴可以扫描下方CSDN官方合作二维码免费领取哦,无偿分享!!!
假如你对网络安全入门感兴趣,那么你需要的话可以
点击这里





欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4