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 Artemis Module - Low Power Machine Learning BLE Cortex-M4F

WRL-15484
$9.95

SparkFun Artemis Global Tracker

WRL-18712
$419.95

SparkFun OpenLog Data Collector with Machinechat - Base Kit

KIT-20673
$244.95

SparkFun OpenLog Data Collector with Machinechat - Environmental Monitoring

KIT-20683
$264.95

Debuggers

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
$10.50

USB 2.0 Cable A to C - 3 Foot

CAB-15092
Retired