[HN Gopher] How to write a bootloader from scratch (2019)
___________________________________________________________________
How to write a bootloader from scratch (2019)
Author : arkj
Score : 90 points
Date : 2022-10-27 17:17 UTC (5 hours ago)
(HTM) web link (interrupt.memfault.com)
(TXT) w3m dump (interrupt.memfault.com)
| Koshkin wrote:
| (For a Cortex-M based microcontroller)
| fra wrote:
| Yes, an important qualifier! In practice the vast majority of
| embedded projects out there are on cortex M, with a bit of
| xtensa (ESP32) and a bit of RISC-V.
| chinabot wrote:
| and 32-Bit microprocessors are still only about 1/3 of total
| microprocessors by volume (source
| https://www.ednasia.com/8-bit-mcu-still-alive-and-kicking/)
| kaycebasques wrote:
| (n00b q) are there big differences for Cortex-A and Cortex-M
| bootloaders? Any helpful tutorials for Cortex-A if so?
| auxym wrote:
| Cortex-A appears to be way more vendor-implementation
| dependent. For example, I remember reading that the Raspberry
| Pi SoC, which uses a Cortex-A72 core, actually boots off its
| GPU.
| megous wrote:
| Yes. DRAM initiazization, MMU, exception levels, trusted-
| firmware, initialization of specialized coprocessors for
| system power states management, more complicated storage
| access options (SD card/eMMC), etc. etc.
| sbf501 wrote:
| Most of those aren't Cortex-A specific, you've just listed
| mostly peripherals that are typically initialized in the
| application space (except for a secure boot).
|
| E.g. you aren't going to go into power savings mode during
| boot, nor are you going to initialize peripherals (because
| their contexts will be lost once you jump to the
| application).
|
| Initializing assymetric processors can be done in
| application space with a variety of tools (AMP) as well. I
| haven't seen a need to initialize them during bootloader1
| phase, but there are lot of use cases.
| dang wrote:
| Related:
|
| _From zero to main(): How to write a bootloader from scratch_ -
| https://news.ycombinator.com/item?id=24635383 - Sept 2020 (44
| comments)
| hra5th wrote:
| 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.
| RealityVoid wrote:
| I'm a bit jealous of the fact they have such good blog posts. I
| did a deep dive on a couple of different architectures and
| always wanted to write something so nice and useful for other
| people with the stuff I know.
| kaycebasques wrote:
| 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/1585708384531...
| zwirbl wrote:
| I'm using https://github.com/probe-rs/hs-probe most of the
| time, sometimes I get out a jlink
| fra wrote:
| Author here. It's surprising how hard CMSIS-DAP adapters are to
| find. The two options shared by codys look reasonable, but I'm
| working on putting together a better option.
| codys wrote:
| Other CMSIS-DAP compatible probes:
|
| - https://makerdiary.com/products/pitaya-link
|
| - https://www.l-tek.com/web-shop/cmsis-dap-debug-probe/
___________________________________________________________________
(page generated 2022-10-27 23:00 UTC)