系统与基础设施interrupt.memfault.com编辑精选
从零到 main():手写一个引导加载程序
From zero to main(): How to write a bootloader from scratch
2020 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇文章来自 Memfault 的 interrupt 博客,讲解如何从零为 Cortex-M 微控制器编写一个 bootloader,并围绕启动流程、向量表等嵌入式底层主题展开。它属于“From zero to main()”系列,适合想理解 MCU 从上电到进入 main() 之前发生了什么的人。
为什么经久不衰:它把 bootloader 这个常被当作黑盒的环节拆成可操作的步骤,是嵌入式开发者入门和复习启动流程的经典实战教程。
HN 评论精选
推荐 Arduino bootloader 作为对照实例,掌握原理后并不复杂。
一个很好的真实世界例子是 Arduino 的 bootloader。读完原文并掌握基本思路后,其实相当简单。
kbumsik查看英文原文
A good real-world example is the Arduino bootloader. [1] Once you read the OP and learn basic idea, it is pretty simple. [1] https://github.com/arduino/ArduinoCore-samd/blob/master/bootloaders/zero/main.c
指出 Cortex-M0 缺少 VTOR,需要手动重映射向量表。
这是个不错的起点。但等你发现 Cortex-M0 没有 VTOR 时就没那么好玩了;不过手动重映射向量表也不算太多工作。
numlock86查看英文原文
A good start. It's fun until you realize Cortex M0 doesn't have a VTOR. Then again, remapping the vector table by hand isn't much work.
高度评价 Memfault 博客,尤其 fault debug 文章值得反复阅读。
对于 Cortex-M 嵌入式主题,Memfault 的博客绝对是市面上最好的之一。尽管作者众多,文章质量始终很高。我在不同系统上调试 hard fault 时,会反复回看这篇 Cortex-M fault debug 文章。即使你经常写 Cortex-M MCU 嵌入式代码,翻翻他们的文章列表,也会找到几篇能教你新东西的实用文章。
hra5th查看英文原文
For Cortex-M embedded topics, memfault's blog is simply one of the best out there. Consistently great posts even though they are written by a bunch of different authors. I go back to https://interrupt.memfault.com/blog/cortex-m-fault-debug all the time when debugging hard faults on different systems. Even if you regularly write embedded code for Cortex-M MCUs, scroll through their list of posts and you'll find several that will teach you something new and useful.
指出教程所用调试适配器已停产,寻求替代方案。
教程里提到的 CMSIS-DAP 适配器已经停产了。有没有硬件高手能推荐一个合适的替代品?我也在 Twitter 上问了作者。
kaycebasques查看英文原文
The CMSIS-DAP adapter referenced in the tutorial is discontinued. Can one of you hardware pros point me to a suitable replacement? Also asked the author here: https://mobile.twitter.com/kaycebasques/status/1585708384531099648
历次讨论
同类还值得读
TTY 揭秘(2008)
The TTY demystified (2008)
经典文章深入剖析了 Unix/Linux 中 TTY 子系统的工作原理,包括线路规程、终端驱动、信号与控制字符等机制。
系统与基础设施上首页 11 次 · 2009–2025linusakesson.net编辑精选为什么 GNU grep 这么快
Why GNU grep is Fast
FreeBSD 邮件列表上一篇广为流传的帖子,解释 GNU grep 为什么快:核心在于 Boyer-Moore 字符串搜索算法配合精心优化的内部循环和 I/O,让程序在搜索时“…
系统与基础设施上首页 9 次 · 2010–2022lists.freebsd.orgXplain:为普通人讲解 X11
Xplain – Explaining X11 for the rest of us
《Xplain》是作者(HN 用户 Jasper_)写的一系列 X11 长文,用他在浏览器中重建的 X11 绘图模型做交互演示,讲解 X11 的绘图模型与窗口系统设计。
系统与基础设施上首页 6 次 · 2013–2020magcius.github.io编辑精选旋风教程:为 Linux 创建极小 ELF 可执行文件(1999)
A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux (1999)
breadbox 写于 1999 年的经典教程,主题是如何为 Linux 手工构造并裁剪出体积极小的 ELF 可执行文件。
系统与基础设施上首页 6 次 · 2007–2025muppetlabs.comPostgreSQL 内部原理
The internals of PostgreSQL
《The Internals of PostgreSQL》是一本免费在线书籍,系统讲解 PostgreSQL 的内部实现,包括查询处理、并发控制、WAL、缓冲区管理等核心机制。
系统与基础设施上首页 5 次 · 2017–2025interdb.jp编辑精选