Firmware for the Sinara 8451 Thermostat
Go to file
Sebastien Bourdeauducq 6ae87db7e1 commit missing file 2019-03-22 22:35:38 +08:00
.cargo gdb with `cargo run` 2019-03-19 17:16:45 +01:00
nix commit missing file 2019-03-22 22:35:38 +08:00
src add feature "generate-hwaddr" to generate indivudal MAC addrs from device electronic signature 2019-03-21 17:41:33 +01:00
.gitignore create nix build infrastructure 2019-03-07 16:27:33 +01:00
Cargo.lock Cargo.lock: update 2019-03-22 12:59:11 +01:00
Cargo.toml add feature "generate-hwaddr" to generate indivudal MAC addrs from device electronic signature 2019-03-21 17:41:33 +01:00
LICENSE LICENSE: add GPL-3 2019-03-18 21:47:18 +01:00
README.md add README 2019-03-21 17:56:06 +01:00
build.rs create nix build infrastructure 2019-03-07 16:27:33 +01:00
default.nix cleanup + build gdb on hydra 2019-03-22 20:34:32 +08: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
release.nix fix gdb.nix invokation 2019-03-22 22:29:56 +08:00
shell.nix cleanup + build gdb on hydra 2019-03-22 20:34:32 +08:00

README.md

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.