Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

← Back to Start Here

LEARN · FIRST PRINCIPLES

How software reaches hardware

Build is not UploadSeparate creation of firmware from its transfer and execution.

Build · creates firmware from saved source

  1. src/main.cppthen
  2. compilerthen
  3. linker + support codethen
  4. firmware

↓ firmware to Upload

Upload · transfers firmware via Uno USB-to-serial

  1. Uploadthen
  2. Uno flashthen
  3. running processor

reviewed Uno board environment; USB data required

Save the C++ file. Build compiles it and links support code into firmware for the selected board. Upload transfers firmware into the Uno’s retained flash storage. When powered or restarted, the processor runs that stored program.

Connections and limits

Saved C++ source is translated by a compiler. A linker combines translated pieces and support code into firmware. Upload transfers it through the reviewed Uno USB-to-serial/programming route into flash. At startup the processor follows the stored instructions.

Some Upload commands build first, but creation and transfer remain separate. A successful build does not update the board; a failed upload can leave old firmware. The Uno transport description is board-specific.

The board does not understand your English intention or execute the letters displayed in the editor. Written code is transformed into processor instructions; the processor follows those instructions. Information chooses behavior. Electrical energy powers the board and the parts it controls. The two journeys are related but different.

Person → computer. You choose a result and use the computer's keyboard and editor to express it. A computer has a processor, a part that follows instructions, and memory, places holding instructions or information. An editor is the program that lets you change text.

Computer → source file. Save the text as a file, a named piece of stored information. Our project, the group of related files and settings, uses C++ code in src/main.cpp. That path means main.cpp inside the src folder. Saving changes the file on the computer. It does not change the board.

Source file → Build. PlatformIO, our project/build management tool inside VS Code, reads the project's settings. The platformio.ini file selects a build environment: settings for the actual board and supporting software. An Uno program needs the reviewed Uno settings. The written language is C++; VS Code and PlatformIO are tools for working with it.

Build → compiler and linker. A compiler checks and translates the written code for the chosen processor. It may stop with an error, a message that the requested operation failed. A linker then joins translated pieces with reusable support code from libraries and the Arduino framework. A framework is the support code providing the startup machinery and familiar board functions. These stages together make a runnable result. A successful translation does not prove your wiring or intended behavior is correct.

Compiler and linker → firmware. The result is an encoded program suitable for the target board, commonly called firmware. It is sometimes called a binary image: “binary” means represented using two-valued bits, and “image” here means program data, not a photograph. It is a different representation of the program, not the original C++ text. Choosing a different board can require a different result.

Firmware → Upload. Upload transfers the built result using a tool and communication route appropriate to the board. For the reviewed Uno R3 setup, data goes through USB to the board's USB-to-serial hardware, then to the microcontroller's programming mechanism. Serial means information sent in sequence. Some other boards use native USB or a separate programming connection, so this Uno description is not a universal transport rule. Upload can first trigger Build; transfer is still a separate job.

Upload → stored program. The Uno's bootloader, a small existing program that receives new firmware during programming, writes the new program into flash memory. Flash is storage that retains data when power is removed. Successful Upload is evidence of transfer; it is not proof the physical circuit works. A failed transfer can leave the previous firmware in place.

Stored program → running processor. At startup the processor begins following the stored machine instructions. Working memory holds values while the program runs. The Arduino support code calls setup() once and then repeatedly calls loop(). Turning the board off removes power; it normally retains the firmware but does not retain ordinary changing working values.

Processor → GPIO. GPIO means general-purpose input/output: connections the program can read or control. Calling pinMode configures a connection's role. Calling digitalWrite requests a digital output state, HIGH or LOW. Those states correspond to voltage ranges relative to ground, the chosen zero-volt comparison point. Software changes electrical control hardware; it does not make the pin supply unlimited energy.

GPIO → connected circuit. In our Uno D8 example, an output HIGH provides a voltage difference along a path through a resistor, an LED and ground. Voltage is electrical energy difference per charge; current is charge passing per second. The resistor limits that current. The LED emits light when suitably connected in its allowed direction. USB supplies the energy through the board's internal power connections. LOW brings this output near ground and removes the forward-driving difference in this circuit.

Circuit → observable result. The light turns on and off. If the physical path is broken or the LED is backward, correctly transferred instructions can run without the expected light. If the program is wrong, perfect wiring can show the wrong timing. Observe both sides: read Build/Upload messages and check the circuit with power disconnected before changing uncertain wiring.

The beginner software-pipeline diagram shows Build and Upload separately. Read the fully explained example, then the existing first lab. For technical detail, see C++ source to firmware, PlatformIO and Microcontrollers.