aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2021-02-08 17:36:28 +1300
committerDavid Phillips <david@yeah.nah.nz>2021-02-08 17:36:28 +1300
commitc1a8fb3fea6360010743bae865d5fe6bfdda8eac (patch)
treeea80cebce143244f0b59e27f9eea324ade49f0ae
parentbd929ae00529139ceb743bd9b3d67dc6f25a83de (diff)
downloadaltimeter-c1a8fb3fea6360010743bae865d5fe6bfdda8eac.tar.xz
Add quick README.md
-rw-r--r--README.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..15a444b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,64 @@
+# Altimeter thingo
+
+## Getting Started
+
+### Dependencies
+
+Bare minimum, you will need:
+
+* make
+* avr-gcc
+* avr-libc
+
+If you want to flash to a real board, you will need:
+
+* avrdude
+
+If you want to simulate a mock/fake version of the software on a virtual AVR
+before flashing, you will need:
+
+* qemu-avr
+
+### Build
+
+ $ make all
+ ...
+ $ file build/altimeter*.elf
+ build/altimeter.elf: ELF 32-bit LSB executable, Atmel AVR 8-bit, version 1 (SYSV), statically linked, with debug_info, not stripped
+ build/altimeter_sim.elf: ELF 32-bit LSB executable, Atmel AVR 8-bit, version 1 (SYSV), statically linked, with debug_info, not stripped
+
+### Run mock/sim build of software in QEMU
+
+The sim build of the software has peripherals mocked out so that the software
+can run in QEMU, where the only peripherals available on the AVR are timers and
+the USART controller.
+
+Thus, the sim build isn't very useful for hacking on I/O driver code, but is
+perfectly fine for higher level logic, such as UI and business logic.
+
+A simulated barometer is provided, which cycles through some preset pressure
+values each time it is asked for pressure. The HD44780 LCD is replaced with a
+thin UART driver instead, which QEMU puts on stdout.
+
+ $ make emu
+
+and from a separate terminal, attach GDB. Optionally set breakpoints before
+unpausing qemu:
+
+ $ make gdb
+ (gdb) cont
+
+You should see some activity in the emulated serial output back on the first
+terminal. Use GDB as normal to play/pause/debug the software. Ctrl+C and k to
+end QEMU.
+
+### Flash good software to chip
+
+With the board reset into programming mode, run avrdude through the makefile
+recipe:
+
+ $ make flash PORT=/dev/ttyACMx
+
+...replacing `/dev/ttyACMx` with the right tty device that shows up when you
+put your microcontroller into programming mode.
+