Enginursday: Exploring the Embedded Startup Process

Let's take a look at what makes 'main()' feel so cozy and welcoming - what has to happen to have variables initialized, objects constructed and stacks a-stackin?

Artemis, my close friend, has urged me to learn much more about the bare-metal details of getting code running and supporting the familiar features that we often take for granted in C++. It is actually a very interesting topic and a beneficial thing to understand when working on embedded systems. Sadly, however, it is a fairly challenging topic to find information about on the internet - and what you can find is daunting, to say the least.

Since we are not fans of reinventing the wheel we've developed some examples you can follow along with using an Artemis board. After doing so you will know:

  1. How the linker organizes compiled code
  2. How startup code initializes variables
  3. How the stack and heap are managed
  4. How global/static object constructors are conveniently called before you get to main()

Check out the examples, explanation and instructions on the embedded-startup exploration repo!

Here are some useful tools to have along the way:

Artemis Boards

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95

SparkFun Artemis Development Kit

DEV-16828
$48.50 $21.83

SparkFun OpenLog Artemis

DEV-16832
$54.95

SparkFun OpenLog Data Collector with Machinechat - Air Quality Monitoring

KIT-20684
$269.95

Debuggers

SparkFun Thing Plus - nRF9160

WRL-17354
$139.95

Silicon Labs BGM220 Explorer Kit

DEV-17588
$14.95

Segger J-Link EDU Mini

PGM-24078
$60.00

Accessories

SparkFun Serial Basic Breakout - CH340C and USB-C

DEV-15096
$9.95

USB 2.0 Cable A to C - 3 Foot

CAB-15092
Retired