Terasic DE10-Nano · Intel Cyclone V SoC

Cyclone V
From Scratch

Build an FPGA + Linux + IoT system step by step: VHDL peripherals, U-Boot and the kernel, C drivers, MQTT and a live dashboard.

27 episodes 3 h 52 min total 6 parts 4 VHDL peripherals
WHAT YOU'LL BUILD

One board, every layer of the stack

Custom VHDL peripherals

GPIO, I²C, SPI and UART as Avalon-MM slaves.

Linux built from source

U-Boot, the kernel and a Debian rootfs.

C drivers with mmap

Talk to your hardware from user space.

Live IoT dashboard

MQTT to the browser in real time.

Episodes

PART 1

Start

3 episodes · 30 min
EP01 10 min

What we're building + DE10-Nano tour

  • HPS (ARM) vs FPGA on one chip
  • How the lightweight bridge connects them
  • The project roadmap
README.md
Coming soon
EP02 10 min

Installing Quartus 18.1 Lite, SoC EDS and the USB-Blaster

  • Install on Windows or Ubuntu
  • udev rule and VM USB filter
  • jtagconfig shows the board
no files
Coming soon
EP03 10 min

First FPGA design: blink an LED over JTAG

  • VHDL counter
  • Pins from the manual
  • Programming the right device in the JTAG chain
blink.vhd
Coming soon
PART 2

FPGA design

7 episodes · 1 h 7 min
EP04 10 min

The Terasic GHRD + baseline compile

  • What every project file does
  • The HPS component
  • Why you compile before changing anything
soc_system.qsys
Coming soon
EP05 8 min

Your first Avalon-MM slave

  • Avalon signals and read latency
  • Word vs byte addresses
  • Input synchronizers
simple_gpio.vhd
Coming soon
EP06 10 min

Platform Designer: components, cleanup and the "overlaps" error

  • _hw.tcl components
  • Connecting to the lightweight bridge
  • Fixed address map and scripted rebuild
simple_gpio_hw.tclbuild_soc_system.tcl
Coming soon
EP07 12 min

An I²C master in VHDL

  • Open-drain lines · START, ACK, STOP
  • A step sequencer
  • Simulation with a fake BME280
simple_i2c.vhdtb_simple_i2c.vhd
Coming soon
EP08 9 min

An SPI master for the MCP3008

  • SPI mode 0 and the 24-bit frame
  • Auto-scanning 8 ADC channels
  • Testbench
simple_spi_mcp3008.vhd
Coming soon
EP09 9 min

A UART with FIFOs

  • Start/stop bits, sampling in the middle
  • Why FIFOs matter for Linux
  • Loopback test
simple_uart.vhdfifo_sync.vhd
Coming soon
EP10 9 min

Top level, pins, compile, timing, .rbf

  • Matching generated port names · JP1 pin mapping
  • Timing Analyzer
  • Converting to .rbf
DE10_NANO_SoC_GHRD.vhdcompile.sh
Coming soon
PART 3

Linux

6 episodes · 50 min
EP11 9 min

How the Cyclone V boots + a prebuilt Debian SD card

  • Boot ROM → SPL → U-Boot → Linux
  • The a2 partition
  • Writing the card safely
make_sdcard_ikwzm.sh
Coming soon
EP12 6 min

First boot: console, network, SSH

  • Serial console at 115200
  • Network and SSH
  • The missing real-time clock
no files
Coming soon
EP13 7 min

Loading our FPGA from Linux, at every boot

  • Device-tree overlays and FPGA manager
  • Reading the System ID
  • systemd service
soc_system.dtsload-fpga.sh
Coming soon
EP14 10 min

Building U-Boot from your own Quartus project

  • hps_isw_handoff and BSP generation
  • qts-filter.sh
  • u-boot-with-spl.sfp
01_build_uboot.sh
Coming soon
EP15 8 min

Building the Linux kernel

  • socfpga_defconfig
  • FPGA manager options
  • Device tree choice
02_build_kernel.sh
Coming soon
EP16 10 min

Debian rootfs + your own SD card

  • debootstrap + QEMU
  • U-Boot loads the FPGA before Linux
  • Booting a fully self-built card
03_build_rootfs.shboot.cmd
Coming soon
PART 4

C on the ARM

5 episodes · 37 min
EP17 8 min

Talking to the FPGA: /dev/mem and mmap

  • devmem2 first, then mapping the bridge
  • Why volatile matters
  • LED chaser and inputs
fpga.ctest_gpio.c
Coming soon
EP18 6 min

Compiling for ARM + generated headers

  • Native vs cross compile
  • The glibc trap
  • sopc-create-header-files
Makefile
Coming soon
EP19 6 min

Reading the ADC: light sensor and potentiometers

  • Voltage dividers
  • Reading 8 channels
  • Counts to volts
test_adc.c
Coming soon
EP20 10 min

I²C from C: a complete BME280 driver

  • Bus scan and chip ID (BME280 vs BMP280)
  • Factory calibration
  • Compensation formulas
i2c.cbme280.c
Coming soon
EP21 7 min

Debugging: Bus error, wrong addresses, no ACK

  • A step-by-step checklist
  • Testing single registers
  • Reading NACK
register_map.md
Coming soon
PART 5

IoT

5 episodes · 40 min
EP22 7 min

Your own MQTT broker

  • Publish/subscribe
  • Mosquitto with passwords
  • Testing with two terminals
de10nano.conf
Coming soon
EP23 9 min

sensor_monitor: alarm logic + MQTT over Ethernet

  • Settings without passwords in code
  • Arm/disarm logic
  • Auto-reconnect with libmosquitto
sensor_monitor.cmqtt_eth.c
Coming soon
EP24 9 min

A live web dashboard with Flask + Socket.IO

  • MQTT to browser in real time
  • Charts
  • Online/offline detection
app.pyapp.js
Coming soon
EP25 8 min

ESP32 as a Wi-Fi modem

  • Flashing ESP-AT
  • The UART1 pin gotcha
  • Loopback and AT tests
test_uart.c
Coming soon
EP26 7 min

Publishing through the ESP32

  • AT command driver
  • Why MQTTPUBRAW
  • Unplug Ethernet, still online
esp32_at.c
Coming soon
PART 6

Finish

1 episode · 8 min
EP27 8 min

Autostart, full demo and where to go next

  • systemd ordering
  • Every feature live
  • Ideas for your next peripheral
sensor-monitor.service
Coming soon
HARDWARE YOU NEED

The bill of materials

  • DE10-Nano board
  • microSD card ≥ 8 GB
  • BME280 I²C
  • MCP3008 SPI ADC
  • LDR + 10 kΩ ADC ch
  • 2 × potentiometer ADC ch
  • PIR sensor GPIO
  • Push button GPIO
  • 2 × LED + 220 Ω GPIO
  • Active buzzer GPIO
  • Breadboard + jumpers
  • ESP32 optional