ABC of Electronics cosycom.com
Free guides: Full Course Index Key Programming Languages Digital Electronics AI & Semiconductor Chips
LESSON 20 / 20 — KEY PROGRAMMING LANGUAGES IN ELECTRONICS

From Code to Silicon: Compilers, Toolchains & Flashing Firmware

Writing code is only step one — this lesson covers what actually happens between clicking 'upload' and a chip running your program.

Whatever language you write in, a microcontroller only understands machine code specific to its own architecture. A compiler translates your source code into that machine code, and a linker combines it with any libraries into a single file the chip can run. Together, the compiler, linker, and related tools are called a toolchain.

That finished file then has to be moved onto the chip itself, a step usually called flashing or uploading. A small program called a bootloader — already sitting in a reserved part of the chip's memory — receives the new file over USB or a dedicated programmer and writes it into the chip's flash memory, ready to run the next time the board resets.

Interpreted languages like MicroPython skip most of this: instead of compiling to machine code ahead of time, an interpreter already flashed onto the chip reads and runs your script directly, which is part of why development feels faster but execution runs slower than compiled C or C++.

THE PIPELINE
Source code → compiler → machine code → linker → binary file.
Binary file → flashed onto the chip via a bootloader/programmer.
Chip resets and starts running the new firmware.