Firmware for the Sinara 8451 Thermostat
Go to file
Sebastien Bourdeauducq 27e011ccb6 fix cargo hashes 2019-03-22 17:07:10 +08:00
.cargo gdb with `cargo run` 2019-03-19 17:16:45 +01:00
nix fix cargo hashes 2019-03-22 17:07:10 +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-21 17:41:03 +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 nix: fetch rustManifest explicitly by default 2019-03-19 22:24:02 +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
release.nix release.nix: make top-level nix-expression palatable to Hydra 2019-03-22 16:54:53 +08:00
shell.nix shell.nix: rm obsolete parameter 2019-03-19 21:31:46 +01: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.