Firmware for the Sinara 8451 Thermostat
Go to file
2019-05-09 21:04:18 +02:00
.cargo use NixOS 19.03 multiarch gdb instead of custom build 2019-04-12 17:14:38 +08:00
nix nix: update sha256 2019-05-09 21:04:18 +02:00
src clippy delint 2019-04-27 15:25:27 +02:00
.gitignore create nix build infrastructure 2019-03-07 16:27:33 +01:00
build.rs create nix build infrastructure 2019-03-07 16:27:33 +01:00
Cargo.lock bump dependencies to now stable versions 2019-05-09 20:56:25 +02:00
Cargo.toml bump dependencies to now stable versions 2019-05-09 20:56:25 +02:00
default.nix default.nix: replace $BIN with ${firmwareBinary} 2019-04-05 23:13:49 +02:00
LICENSE LICENSE: add GPL-3 2019-03-18 21:47:18 +01:00
memory.x memory.x: fix RAM2 region, place stack in CCMRAM 2019-03-12 22:52:52 +01:00
openocd.gdb gdb with cargo run 2019-03-19 17:16:45 +01:00
README.md add README 2019-03-21 17:56:06 +01:00
release.nix use NixOS 19.03 multiarch gdb instead of custom build 2019-04-12 17:14:38 +08:00
shell.nix use NixOS 19.03 multiarch gdb instead of custom build 2019-04-12 17:14:38 +08:00

Synopsis

Exposes readings from an ADC pin (currently: PA3) of the board via a TCP service on the Ethernet port.

Network Protocol

Sensor readings produce lines of key=value pairs, joined by ,, terminated by "\r\n".

t=21000,pa3=685
t=22000,pa3=684
t=23000,pa3=681
t=24000,pa3=696
t=25000,pa3=673
t=26000,pa3=689
t=27000,pa3=657
t=28000,pa3=654
t=29000,pa3=652
t=30000,pa3=662
t=31000,pa3=663
Key Value Unit
t Time ms
pa3 ADC reading mV

LEDs

Colors indicate what the MCU is occupied with.

Color Indication
Green WFI (idle)
Blue Network poll
Red Message broadcast

Crate features

  • semihosting enables log output via the cortex-m-semihosting crate. Use only in development! MCU will hang when no OpenOCD is running.

  • generate-hwaddr generates an Ethernet MAC address by hashing the unique device ID from flash memory.

Instructions

Made for NixOS

Build the firmware with default.nix

  • nix-build
  • This uses cargo-vendor to bundle dependencies, so that unstable versions from git can be used.
  • Run result/bin/flash-adc2tcp to flash a devboard with OpenOCD and quit.

Development environment with shell.nix

  • nix-shell
  • Spawning openocd, the devboard should be connected already.
  • Instructions (cargo run --release) are printed.