A collection of tiny embedded-linux projects for the BeagleBone Black (BBB).
Processor: AM3358 ARM Cortex-A8
OS: Debian 10.3 Buster IoT (without graphical desktop)
Kernel release: 4.19.94-ti-r42
GCC version: 8.3.0
Link to the official docs here
I recommend reading cross-compilation-setup/README.md
first.
It explains how I set up my computer (Mac M1) to cross compile programs for the board and upload them there.
The project uses a global CMake file with different targets.
Dependencies are managed through Conan.
The file profile_crossbuild
tells the latter which platform we're generating binary files for.
To build:
mkdir build
cd build
conan install .. --build=missing --profile=../profile_crossbuild
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Build
cmake --build .
The executables will be placed in build/bin
.
For debugging purposes, you may want to build the projects for the local VM too.
To avoid future headaches, adjust your Conan profile to use the CXX11 ABI by default before proceeding.
Then, to build:
mkdir build
cd build
conan install .. --build=missing
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Build -DBUILD_LOCAL=1
cmake --build .
Exception: the project onboard-leds
is built using a regular Makefile
, so cd
into the directory and simply call make
.
Exception: the project writing-lkm
uses Kbuild
; check its README for details.
Here are the projects, in the order they've been developed:
-
onboard-leds
: play with the onboard LEDs (turn on, turn off, flash) -
gpio
: a cli utility that allows changing direction, pull-up/down resistor, and value of gpio pins -
using-lkm
: use the pre-built LKM to read a temperature sensor (I2C) -
i2c
: use system calls to read a temperature sensor (I2C) -
mqtt
: publish data to Adafruit's MQTT broker (or to a local Mosquitto broker) -
watchdog
: use the watchdog timer to reboot the board after 30 seconds of inactivity -
writing-lkm
: write a tiny loadable kernel module
Others:
The nice cartoon sketch is offered by Pixabay users under their generous free license.