惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

嵌入式开发

求推荐支持 eBPF 的国产 ARM 开发板 求个长期合作的逆向开发 ******野火开发板 stm32 教程错误很多***** - V2EX 嵌入式开发能不能借助 AI 编写程序 - V2EX 有没有类似 ESP32 的芯片,内存要大的? - V2EX 有干嵌入式的老哥吗? stm32+jlink,使用 swd 调试时经常蓝屏是怎么回事 - V2EX 有干嵌入式的老哥吗,有一个 keil 的问题 - V2EX =RS485 总线冲突 Gemini 和 Chatgpt 给出不同的答案=== - V2EX 嵌入式软件工程师如何提升自己? - V2EX ST-Link 在 CLion 下载失败求助 - V2EX 个人认为嵌入式领域最无用的发明---色环电阻 - V2EX v 嵌入式设备适合用 vlc 吗 - V2EX 解析 pads pt9 格式文件,大家有没有什么好办法解析,可以有偿 - V2EX 请教嵌入式自学路径 - V2EX 嵌入式 AI 系统 SDK - V2EX 从开发一个六足机器人入手,要怎么做 - V2EX 请教实现 嵌入式二维码扫描的问题, 新手, 非常新 - V2EX 0 基础嵌入式开发学习 - V2EX 嵌入式软件(单片机)相关问题 - V2EX ESP32C6 系列教学视频,每天增加,大概 20 集,如果有用的可以下载 - V2EX 过年时候写的,劣质古早 mcu 的 TFT 屏幕 +ILI9341 亮度控制方案 - V2EX 嵌入式入职没人带 ,如何提升自己的开发工作经验呢?提升能力?有没有教程推荐 - V2EX 想给和家亲摄像头刷 OpenIPC,求助 u-boot 相关问题 - V2EX 嵌入式软硬件交流贴 - V2EX 嵌入式设备(无任何界面,带喇叭)的语音通话技术选型 - V2EX 需要开发吸顶灯和可视化门铃,有人接单么 - V2EX 业余想学习和玩一下单片机,求助一下 - V2EX 最近的想法<打造下一代的嵌入式软件开发 IDE> - V2EX 想将投影仪接入米家,请教一下 ESP32 重放投影仪蓝牙遥控器的按键,用于控制投影仪的开关 - V2EX 想学嵌入式,黑马的嵌入式培训怎么样? - V2EX 付费求教 ESP32-C3 射频设计问题,目前 WiFi 不能连接其他 AP,无法成功创建 AP,但能正常搜索到其他 AP - V2EX 嵌入式前景怎么样 - V2EX 嵌入式怎么涨了那么多? - V2EX 需要做一个 PCB 板,增压和降压以及蓝牙控制 - V2EX 纯新手业余爱好者怎么入门 PCB 设计、嵌入式开发啊? - V2EX NCU972 启动卡内核加载 - V2EX NCU970 qt4.8.5 交叉编译环境搭建 - V2EX micropython 开发推荐什么 ide - V2EX 求问交叉编译中 gdb 的使用 - V2EX 移植好 U8g2 图形库的 STM32F407 标准库工程模板, 0.96 寸 OLED 驱动程序 - V2EX Java 岗想转嵌入式,但不知哪个行业更有前途越老越香的那种 - V2EX 求推荐一个 RK3588 开发版 - V2EX 这段浮点运算代码性能为何如此低下 - V2EX 解决请喝奶茶,实在搞不定了 esp32 heap_caps_malloc 分配内存崩溃 - V2EX arm 架构下 u-boot 可不可以不指定 dtb 启动内核? - V2EX 嵌入式的私活好少啊,嵌入式项目资源共享群有吗? - V2EX 感觉嵌入式开发的门槛不在语言而在环境上… - V2EX 有没有哪款 arm 的开发板支持 smmu(iommu)? - V2EX 楼主最近需要研究 arm 架构,想请教 v 友买哪款 arm 的开发板比较合适? - V2EX 用 stm32cubeide 碰到了一个奇怪的 bug,串口发送要凑满 1kb 的数据才能发
有玩 mcuboot 的吗,可否帮忙看看我的应用为啥启动不了。 - V2EX
msmmbl · 2025-04-07 · via 嵌入式开发

最近在 stm32F030c8 上尝试使用 mcuboot ,方便今后 ota 。框架采用了 zephyr

stm32F030c8 的闪存有 64KB ,为了方便调试,mcuboot 编译完了有 20 多 KB ,于是我就按照 24KB + 20KB + 20KB 给闪存分为了 boot_partition + slot0_partition + slot1_partition ,三个分区。后面调试通了打算把 boot 分区优化到 16KB 。

mcuboot 直接从 github 上 pull 了最新的代码,然后加了一个 custom 的 board 进去。为了跑通流程,我在 prj.conf 中把:

  1. CONFIG_MAIN_STACK_SIZE 改成了 1024 ,不然会爆内存
  2. CONFIG_BOOT_SIGNATURE_TYPE_NONE ,把验证签名给关了,先跑通后面再开。

之后就是 west build ,然后 upload 到板子上,开机上电,串口正常显示 mcuboot 启动。

之后,写了一个简单的闪灯应用,用了 platform.io + zephyr ,同一套板子配置文件,先不分区直接 upload ,确认了程序能跑。

然后按照说明,

  1. 在 prj.conf 中加了,CONFIG_BOOTLOADER_MCUBOOT=y ,CONFIG_FLASH_MAP=y 。
  2. 之后在 dts 把 flash 的分区信息加上
  3. 在 platform.ini 中加上 build_flags = -DPM_STATIC_YML_FILE=zephyr/pm_static.yml
  4. 创建 pm_static.yml 也把分区信息加上。

一波操作之后生成了带签名的 firmware.elf 。上传到板子上发现不运行。

生成的 firmware 是

Printing content of signed image: firmware.mcuboot.bin

#### Image header (offset: 0x0) ############################
magic:              0x96f3b83d
load_addr:          0x0
hdr_size:           0x200
protected_tlv_size: 0x0
img_size:           0x3d92
flags:              0x0
version:            0.0.0+0
############################################################
#### Payload (offset: 0x200) ###############################
|                                                          |
|              FW image (size: 0x3d92 Bytes)               |
|                                                          |
############################################################
#### TLV area (offset: 0x3f92) #############################
magic:     0x6907
area size: 0x150
        ---------------------------------------------
        type: SHA256 (0x10)
        len:  0x20
        data: 0x90 0x7f 0xa3 0xbc 0x5d 0xdc 0x34 0xa8
              0xa9 0x06 0xa4 0x64 0x5d 0x73 0x79 0x24
              0xea 0x62 0x6e 0x6e 0x37 0x99 0x5c 0x72
              0x61 0x85 0xf1 0xda 0x45 0x72 0x87 0xaa
        ---------------------------------------------
        type: KEYHASH (0x1)
        len:  0x20
        data: 0xfc 0x57 0x01 0xdc 0x61 0x35 0xe1 0x32
              0x38 0x47 0xbd 0xc4 0x0f 0x04 0xd2 0xe5
              0xbe 0xe5 0x83 0x3b 0x23 0xc2 0x9f 0x93
              0x59 0x3d 0x00 0x01 0x8c 0xfa 0x99 0x94
        ---------------------------------------------
        type: RSA2048 (0x20)
        len:  0x100
        data: 0x67 0x30 0x0a 0xf8 0xee 0xad 0xba 0xbf
              0xac 0x22 0x6d 0x3a 0xac 0x76 0x9f 0x60
              0xb0 0x2c 0x3f 0x5e 0x4d 0xf7 0x3f 0x0d
              0x9b 0x24 0xbe 0x4a 0x70 0xa4 0x44 0x08
              0x7c 0xe7 0x27 0xce 0x0d 0xca 0x97 0x18
              0x3c 0xc3 0x15 0xbe 0xb0 0x0b 0xb5 0xf1
              0x10 0xff 0x84 0x59 0xca 0xc2 0x29 0x42
              0xf0 0x8c 0xbb 0xd1 0x38 0xe5 0x6c 0xeb
              0xde 0xf4 0x1f 0xa0 0x8f 0xde 0x0b 0xe2
              0x23 0x3e 0x2e 0xd6 0xcb 0xf6 0x22 0x0d
              0x54 0x88 0xf3 0x7e 0x86 0xd0 0xb7 0x7d
              0x9d 0x75 0x8a 0xa9 0xa0 0x73 0xb6 0xee
              0x9a 0x6b 0x80 0xb9 0xd7 0x87 0x65 0x3c
              0x89 0x3b 0x90 0xd2 0x0a 0xf1 0xcb 0xe8
              0x4b 0x73 0xbd 0xe2 0x05 0x75 0x35 0x8c
              0xc0 0xa0 0x38 0x26 0x10 0xac 0x07 0xf3
              0xae 0x58 0xa0 0x8e 0x64 0x8c 0x06 0x76
              0x15 0x24 0xe5 0xeb 0x9a 0x56 0x97 0x91
              0x99 0xa4 0x18 0xd9 0xd8 0x8a 0xaa 0xcb
              0x73 0x07 0xd0 0xc5 0x96 0x79 0x95 0xa1
              0xf3 0xec 0x21 0xf0 0xae 0xa5 0x8e 0x46
              0xb8 0xdd 0x09 0x0b 0xbc 0x6f 0x4c 0xfe
              0xa8 0x91 0xfc 0xdb 0x10 0x71 0x3a 0x16
              0x5f 0xd2 0xf1 0x49 0x3c 0x24 0x58 0x8f
              0xc5 0x82 0xc3 0x6c 0xf5 0xe9 0x16 0x08
              0xb3 0x35 0x30 0x38 0x08 0x43 0x27 0x25
              0x08 0x61 0x36 0xb8 0x83 0x04 0xac 0xae
              0x94 0x8d 0x27 0x31 0x61 0x6b 0x11 0x1d
              0xa2 0x0f 0x48 0xd9 0x0e 0x5c 0x27 0x3f
              0x3c 0x19 0xa2 0x38 0xe8 0x90 0x32 0x50
              0xd7 0xdd 0x4d 0x9d 0xf5 0x2d 0xa5 0xec
              0xed 0xf6 0x04 0x51 0x91 0xf3 0xe8 0xc8
############################################################
#### End of Image  #########################################
dumpinfo has run successfully

分区信息是:

flash_primary:
  base_address: 0x08000000
  size: 64K
  # Bootloader
  mcuboot:
    address: 0x08000000
    size: 24K
  # Application slot 0
  image_0:
    address: 0x08006000
    size: 20K
  # Upgrade slot
  image_1:
    address: 0x0800b000
    size: 20K

启动时候串口输出:

*** Booting MCUboot v2.1.0-rc1-271-gc8470fb145f8 ***
*** Using Zephyr OS build v4.1.0-1989-g1f9f4c8cee02 ***
MCUBoot
I: Starting bootloader
D: Non-optimal sector distribution, slot0 has 18 usable sectors (20 assigned) but slot1 has 20 assigned
I: Prim
ary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: primary slot
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x6000
I: Image version: v0.0.0
I: Jumping to the first image slot�*

可以看到它 mcuboot 正确识别到了 image ,但是在跳转到 image 的那一刻就挂掉了。

大家指点指点。