The official bare-metal firmware for IoT coffee makers with ARM Cortex-M4 microcontrollers.
# macOS
brew install arm-none-eabi-gcc
# Ubuntu/Debian
sudo apt-get install gcc-arm-none-eabi
# Arch Linux
sudo pacman -S arm-none-eabi-gccgit clone https://github.com/harpertoken/brew.git
cd brew
make clean && make# Pull from GitHub Container Registry
docker pull ghcr.io/harpertoken/brew:latest
# Pull from Docker Hub
docker pull harpertoken/brew:latest
# Run the coffee maker dashboard
docker run -p 8080:8080 ghcr.io/harpertoken/brew:latest#include "heater.h"
#include "pump.h"
#include "control.h"
int main(void) {
heater_init();
pump_init();
while(1) {
coffee_state_machine();
}
return 0;
}// Temperature control
#define MAX_TEMP_CELSIUS 95
#define MIN_TEMP_CELSIUS 20
#define TEMP_HYSTERESIS 5
// Water level protection
#define MIN_WATER_LEVEL 50 // ml
#define CRITICAL_WATER 10 // ml
// Safety timing
#define MAX_BREW_TIME_MS 300000 // 5 minutes// Pin configuration in board/board.h
#define HEATER_PIN 12
#define PUMP_PIN 13
#define TEMP_SENSOR_PIN 0
#define WATER_SENSOR_PIN 1Initialize heater control system.
Control heater state with safety checks.
Initialize pump control system.
Control pump state with flow monitoring.
Main brewing logic with safety interlocks.
typedef enum {
IDLE,
HEATING,
BREWING,
DONE
} coffee_state_t;- Flash: 256KB (STM32F4)
- RAM: 64KB total
- Stack: 4KB (configurable)
- Bootloader: 32KB reserved
# Start web dashboard
go run examples/web_dashboard.go
# Connect to AWS IoT
go run examples/iot_controller.go
# Monitor metrics
go run examples/metrics_collector.go# Deploy infrastructure
aws cloudformation deploy --template-file cloud/infrastructure.yaml --stack-name coffee-maker
# Run monitoring stack
docker-compose up -dmake quality # Run all quality checks
make inspect # Analyze memory layout
make size # Memory usage reportmake flash # Flash to hardware
make debug # Start GDB sessionpre-commit install # Install quality gatesConfigure in linker.ld:
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
}# Debug build
make CFLAGS="-mcpu=cortex-m4 -mthumb -g3 -DDEBUG"
# Release build
make CFLAGS="-mcpu=cortex-m4 -mthumb -O2 -DNDEBUG"This firmware implements production-grade safety practices:
- Memory safety: No dynamic allocation, bounds checking
- Static analysis: cppcheck, MISRA C compliance
- Stack protection: Overflow detection and limits
- Fail-safe design: Safe defaults on all error conditions
We welcome contributions! Please see our contributing guidelines.
./setup_dev.sh # Install dependencies
pre-commit install # Setup quality gates- Follow MISRA C:2012 guidelines
- All code must pass static analysis
- Hardware changes require testing
- Documentation updates required
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Copyright (c) 2026 harpertoken