Bare-metal programming for ARM

Categories:

Recommended

Modern programming takes many forms. There’s web development, desktop application development, mobile development and more. Embedded programming is one of the areas of programming, and can be radically dierent from the others. Embedded programming means programming for a computer that’s mainly intended to be embedded within a larger system, and the embedded computer is usually responsible for a particular task, instead of being a general-purpose computing device. The system where it’s embedded might be a simple pocket calculator, or an industrial robot, or a spaceship. Some embedded devices are microcontrollers with very little memory and low frequencies, others are more powerful.

Embedded computers may be running a fully-fleged operating system, or a minimalistic system that just provides some scheduling of real-time functions. In cases when there’s no operating system at all, the computer is said to be bare metal, and consequently bare metal programming is programming directly for a (micro-)computer that lacks an operating system. Bare metal programming can be both highly challenging and very dierent from other types of programming. Code interfaces directly with the underlying hardware, and common abstractions aren’t available. There are no files, processes or command lines. You cannot even get the simplest C code to work without some preparatory steps. And, in one of the biggest challenges, failures tend to be absolute and mysterious. It’s not uncommon to see embedded developers break out tools such as voltmeters and oscilloscopes to debug their software.

Modern embedded hardware comes in very many types, but the field is dominated by CPUs implementing an ARM architecture. Smartphones and other mobile devices oen run Qualcomm Snapdragon or Apple A-series CPUs, which are all based on the ARM architecture. Among microcontrollers, ARM Cortex-M and Cortex-R series CPU cores are very popular. The ARM architectures play a very significant role in modern computing.

The subject of this ebook is bare-metal programming in C for an ARM system. Specifically, the ARMv7-A architecture is used, which is the last purely 32-bit ARM architecture, unlike the newer ARMv8/AArch64. The -A suix in ARMv7-A indicates the A profile, which is intended for more resource-intensive applications. The corresponding microcontroller architecture is ARMv7-M.

Note that this is not a tutorial on how to write an OS. Some of the topics covered in this ebook are relevant for OS development, but there are many OS-specific aspects that are not covered here.

 

Category:

Attribution

Daniels Umanovskis. Bare-metal programming for ARM. http://umanovskis.se/files/arm-baremetal-ebook.pdf

VP Flipbook Maker

This flipbook was made with the free flipbook maker from Visual Paradigm Online, you can also develop a book like this. Create online flipbooks, design, publish and share your flipbooks online, try it now!