Overview of bare-metal software
The term bare-metal software refers to code with no operating system (OS) or application programming interface (API). It is written directly onto hardware, thus the name of writing software on the “bare-metal” hardware.
If implementing your application is a straightforward task, then bare-metal software makes sense and is a good place to start developing any application. Bare-metal tasks are either polled or triggered by interrupts. More complex scheduling functionality is enabled through an OS. While OSs can be overly complex for simple applications, they introduce a necessary abstraction and management layer needed for most applications. Increasingly, Cortex-M devices perform many tasks (reading sensors, processing sensor data, transmitting data, and more) that can be managed easier by an OS.
Note that you can add functionality to your bare-metal system through middleware stacks—which will be covered later in this chapter...