ECEC 201 · Week 1

Modern Computer: Von Neumann

The board is the course's Linux machine.

Week 1 of 10 · Das Frite

ECEC 201 · Week 1

The board: Das Frite

  • 5 V
  • 3.3 V
  • Ground
  • GPIO
  • I2C
  • SPI
  • UART
  • PWM
  • ADC
  • I2S
  • S/PDIF
  • Clock
  • SDIO

Colours as on the Das Frite pinout, where each pin's name is. The square pad is pin 1.

ECEC 201 · Week 1 · In class

The board is the course's Linux machine.

ECEC 201 · Week 1 · In class

The board is the course's Linux machine. (continued)

ECEC 201 · Week 1 · In class

Log in twice, on the serial console and over SSH, so you have a way in when the network is down.

ECEC 201 · Week 1 · Lecture

Why check a checksum

ECEC 201 · Week 1 · Lecture

Two ways in

Serial consoleSSH
NeedsA USB-to-UART adapter on the headerA working network and an address
Works whenThe network is down or misconfiguredThe board is up and reachable
Good forSeeing what the board prints by itselfEditing, copying files, several terminals

Keep both working: the console is how you fix a broken network.

ECEC 201 · Week 1 · Lecture

The loop: edit, compile, run

#include <stdio.h>

int main(int argc, char *argv[])
{
	for (int i = 0; i < argc; i++)
		printf("argv[%d] = %s\n", i, argv[i]);
	return 0;
}

gcc -Wall -Wextra -o args args.c, then ./args one two. argv[0] is the program's own name.

ECEC 201 · Week 1 · Lecture

Read every warning

printf("%d\n");     /* -Wformat: one %d, no argument */

ECEC 201 · Week 1 · Lab

Lab

  1. Write the term image with the desktop imager and compare its SHA-256 with the published value before you boot.
  2. Log in on the serial console, then over SSH. Write a C program that prints its arguments, compile it on the board with `gcc -Wall -Wextra`, and run it. Second pass: add one line that draws a warning, read the warning, and remove the line.

ECEC 201 · Week 1 · Lab

Lab (continued)

  1. Assemble the lab hand-in: The checksum you compared, a screenshot of the console and SSH logins, and the C file with its compile command and output.

ECEC 201 · Week 1 · Lab

Hand in

The checksum you compared, a screenshot of the console and SSH logins, and the C file with its compile command and output.

ECEC 201 · Week 1 · Homework

Homework

ECEC 201 · Week 1 · Homework

Turn in

Those four commands and one line on what each does.

ECEC 201 · Week 1 · Read

Read

On the lab site: Module 0, First boot, is the flash and the login. Stop before annotating boot stages.

ECEC 201 · Week 1 · Next

Week 2

A C type is a size in memory, and the size belongs to the system, not the language.

Arrow keys or space to move, F for full screen, N for speaker notes, Home and End for the first and last slide. Print gives one slide per page.