Week 1 ยท Lecture outline
What an embedded system is, and a first boot
Module 0: First boot. Lab: Lab 1, first boot. Nothing is due this week.
Learning goals
By the end of the week a student can:
- Say how an embedded Linux system differs from a microcontroller system.
- Explain what an OS image is and what a SHA-256 checksum proves about it.
- Wire a serial console, set its terminal parameters, and say why it is the course's most important instrument.
- Find their way around the shell, and name what
/proc,/sysand/devshow.
Lecture 1, block 1: what an embedded system is
- An embedded system is a computer inside a product, built for one job.
- A microcontroller runs one program from its own flash, with no operating system or a small one.
- A single-board computer is a whole computer on one circuit board, running a general-purpose OS from removable or on-board storage.
- The course follows one such board from the moment power reaches it to a finished product.
Lecture 1, block 2: the course's two boards
- Das Frite and Solitude: an Amlogic system-on-chip, DRAM, SPI NOR flash with UEFI firmware, a 40-pin header.
- Das Frite boots its OS from a USB drive or an eMMC module; it has no card slot. Solitude boots from a microSD card or an eMMC module.
- Both boot Libre Computer's open boot chain, so every stage the course studies is code students can read.
- Show the board pictures and the modules in boot order.
Lecture 1, block 3: images, checksums and boot media
- An OS image is a byte-for-byte copy of a disk.
- A SHA-256 checksum proves the image file is the one that was published; the imager's verify step, or the app's checked write, confirms what was written.
- Two ways to write one: the Libre Computer app for Android, or a desktop imager on a PC.
- Each station keeps two boot media, one holding a spare image.
Lecture 2, block 1: the serial console
- Text output on two wires plus ground, from the first code that runs: before the display, the network or even memory are up.
- The lines cross: the adapter's transmit to the board's receive, the adapter's receive to the board's transmit.
- 3.3 V adapter only, and never connect the adapter's power pin; the board has its own supply.
- Terminal settings: 115200 baud, 8 data bits, no parity, 1 stop bit; start capturing before power-on.
Lecture 2, block 2: the shell and where Linux shows the hardware
- Logging in on the console, then over SSH on the lab network.
- Files and processes: the few commands the labs need.
/proc,/sysand/dev: where Linux shows the hardware it found.- The week 1 log is the map: every later module explains some of its lines.
Lecture 2, block 3: the bench rules
- The header is 3.3 V: never put 5 V on a GPIO pin; it damages the chip for good.
- Power off before rewiring.
- A board that will not boot is never a reason to lose marks: students' own list is on their bench page.
Board demo
- Show a published image's SHA-256 on libre.computer downloads, and check a written image against it.
- With the board unplugged, wire the USB-to-UART adapter on camera, naming each of the three wires; point at the adapter's power pin and leave it unconnected.
- Open the terminal at 115200 8N1, start the capture, and apply power. Let the whole log scroll by unexplained.
- Log in on the console, find the address, and log in again over SSH.
On Das Frite the console is on 40-pin header pins 3 (board receives) and 5 (board transmits), ground on pin 6, and the image is on a USB drive.
On Solitude the console is on its own 3-pin header: pin 1 ground, pin 2 board transmits, pin 3 board receives, and the image is on a microSD card.
Check questions
What does a SHA-256 checksum prove about an image?
That the image file is byte for byte the one that was published, not changed or corrupted on the way. It says nothing about the write: the imager's verify step, or the app's checked write, confirms that. Neither proves the image works on the board.
Why is the serial console the most important instrument in the course?
It works before the display, the network or even memory are up, so it shows every boot stage from the first code that runs, including on a board that stops before Linux.