# 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.