Weavie is an ongoing project to create a tiny, physical weaving pattern computer using only 32-bit ARM assembly. I wanted to learn more about embedded development and assembly programming, and building a weaving pattern editor seemed like a fun challenge. Weavie is built for the STM32 board, and has its own basic emulator based on Rust and Unicorn.
All dependencies are defined in shell.nix
. Run:
nix-shell
Or install using your preferred package manager.
make
- Connect the BOOT0 (B0) pin to the 3.3V PIN. This enables the DFU bootloader mode.
- Connect the board to the USB port.
- Flash the chip:
make flash
To run in QEMU:
make qemu
Restarting QEMU inside gdb:
monitor system_reset
Exiting QEMU:
Ctrl-A X
Debugging in gdb:
make debug
Step through assembly instruction:
si
Inspect register state:
info registers
Inspect memory address:
p/x 0x40020800
x $r2
x/t $r1
x/10x $r1
x/20c $r1
- Board: Adafruit Feather STM32F405 Cortex M4
- Display: Adafruit SHARP 2.7"
- J-Link: SEGGER J-Link EDU Mini
- Keys: NeoKey - Four Mechanical Key Switches
- 3.3V to display VIN (power)
- GND to display GND (ground)
- SCK to display CLK (clock)
- MO (MOSI) to display DI (data input)
- PIN6 to display CS (chip-select)
- STM32F405 Datasheet
- STM32F405 Reference Manual
- Adafruit STM32F405 Feather Express Pinouts
- Adafruit NeoKey 1x4 Pinouts
- SHARP Display Datasheet
- Sharp Memory Display Wiring Guide
- Hello, world" in ARM assembly
- Bare-metal C programming on ARM
- "Bare Metal" STM32 Programming (Part 1): Hello, ARM!
- A bare metal programming guide (ARM microcontrollers)
- HelloSilicon: An introduction to ARM64 assembly on Apple Silicon Macs
- ARM Assembly Internals & Reverse Engineering
- Emulating an STM32F4 in QEMU to test ARM assembly
- Programming of ARM Cortex-M microcontrollers
- SPI: The serial peripheral interface
- Hubris STM32F4 config