Merge branch 'master' into new-pac

* master:
  bump serde-json-core
  v0.2.0
  add changelog
  remove nix stuff
master
Robert Jördens 2019-05-30 13:50:42 +00:00
commit f0ec1e37fc
9 changed files with 21 additions and 11723 deletions

14
CHANGELOG.md Normal file
View File

@ -0,0 +1,14 @@
# Changelog
## [v0.2.0] 2019-05-28
* Initial basic release
* Ethernet support
* IIR filter code
* ADC and DAC SPI support
* ADC/DAC timing and interrupts
* Board configuration, bootstrap
## [v0.1.0] 2019-03-10
* First bits of code published

8
Cargo.lock generated
View File

@ -223,7 +223,7 @@ dependencies = [
[[package]]
name = "serde-json-core"
version = "0.0.1"
source = "git+https://github.com/quartiq/serde-json-core.git?rev=6143ac2#6143ac229ec3f5382555f37fe673413c8b46b0cf"
source = "git+https://github.com/quartiq/serde-json-core.git?rev=82fdca9#82fdca9eb08183f00480eea289e809e5dd37e9fe"
dependencies = [
"heapless 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)",
@ -251,7 +251,7 @@ dependencies = [
[[package]]
name = "stabilizer"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"cortex-m 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cortex-m-log 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -261,7 +261,7 @@ dependencies = [
"panic-abort 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"panic-semihosting 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)",
"serde-json-core 0.0.1 (git+https://github.com/quartiq/serde-json-core.git?rev=6143ac2)",
"serde-json-core 0.0.1 (git+https://github.com/quartiq/serde-json-core.git?rev=82fdca9)",
"smoltcp 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stm32h7 0.7.0",
]
@ -344,7 +344,7 @@ dependencies = [
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)" = "a72e9b96fa45ce22a4bc23da3858dfccfd60acd28a25bcd328a98fdd6bea43fd"
"checksum serde-json-core 0.0.1 (git+https://github.com/quartiq/serde-json-core.git?rev=6143ac2)" = "<none>"
"checksum serde-json-core 0.0.1 (git+https://github.com/quartiq/serde-json-core.git?rev=82fdca9)" = "<none>"
"checksum serde_derive 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)" = "101b495b109a3e3ca8c4cbe44cf62391527cdfb6ba15821c5ce80bcd5ea23f9f"
"checksum smoltcp 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fef582369edb298c6c41319a544ca9c4e83622f226055ccfcb35974fbb55ed34"
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"

View File

@ -1,6 +1,6 @@
[package]
name = "stabilizer"
version = "0.1.0"
version = "0.2.0"
authors = ["Robert Jördens <rj@quartiq.de>"]
description = "Firmware for the Sinara Stabilizer board (stm32h743, eth, poe, 2 adc, 2 dac)"
categories = ["embedded", "no-std", "hardware-support", "science"]
@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
keywords = ["ethernet", "eth", "stm32", "stm32h7", "adc", "dac", "tcp", "no-std", "embedded"]
repository = "https://github.com/quartiq/stabilizer"
readme = "README.md"
#documentation = "https://docs.rs/stabilizer/"
documentation = "https://docs.rs/stabilizer/"
edition = "2018"
publish = false
exclude = [
@ -39,7 +39,7 @@ heapless = { version = "0.4" }
[dependencies.serde-json-core]
# version = "0.0"
git = "https://github.com/quartiq/serde-json-core.git"
rev = "6143ac2"
rev = "82fdca9"
[dependencies.stm32h7]
path = "../stm32-rs/stm32h7"

View File

@ -1,32 +0,0 @@
{ # Use master branch of the overlay by default
mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz),
rustManifest ? builtins.fetchurl "https://static.rust-lang.org/dist/channel-rust-nightly.toml"
}:
let
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
in
with pkgs;
let
rustPlatform = recurseIntoAttrs (callPackage ./nix/rustPlatform.nix {
inherit rustManifest;
});
stabilizer = callPackage ./nix/stabilizer.nix { inherit rustPlatform; };
in
stdenv.mkDerivation {
name = "stabilizer-dist";
buildInputs = [ stabilizer ];
src = ./.;
dontBuild = true;
installPhase =
let
firmwareBinary = "$out/lib/stabilizer.elf";
in ''
mkdir -p $out/bin $out/lib $out/nix-support
ln -s ${stabilizer}/lib/stabilizer ${firmwareBinary}
echo file binary-dist ${firmwareBinary} >> $out/nix-support/hydra-build-products
'';
}

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
{ stdenv, cacert, git, cargo, cargo-vendor }:
{ name, src, sha256 }:
let
# `src` restricted to the two files that define dependencies
cargoOnlySrc = stdenv.mkDerivation {
name = "${name}-cargo";
inherit src;
phases = "installPhase";
installPhase = ''
mkdir $out
cp ${src}/Cargo.{toml,lock} $out/
mkdir $out/src
touch $out/src/main.rs
'';
};
in
stdenv.mkDerivation {
name = "${name}-vendor";
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
src = cargoOnlySrc;
phases = "unpackPhase patchPhase installPhase";
installPhase = ''
if [[ ! -f Cargo.lock ]]; then
echo
echo "ERROR: The Cargo.lock file doesn't exist"
echo
echo "Cargo.lock is needed to make sure that cargoSha256 doesn't change"
echo "when the registry is updated."
echo
exit 1
fi
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo vendor
cp -ar vendor $out
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
preferLocalBuild = true;
}

View File

@ -1,23 +0,0 @@
{ recurseIntoAttrs, stdenv, lib,
makeRustPlatform,
fetchurl, patchelf,
rustManifest ? ./channel-rust-nightly.toml
}:
let
targets = [
"thumbv7em-none-eabihf"
];
rustChannel =
lib.rustLib.fromManifestFile rustManifest {
inherit stdenv fetchurl patchelf;
};
rust =
rustChannel.rust.override {
inherit targets;
};
in
makeRustPlatform {
rustc = rust;
cargo = rust;
}

View File

@ -1,45 +0,0 @@
{ stdenv, rustPlatform, cacert, git, cargo-vendor }:
with rustPlatform;
let
sha256 = "1m4cxf6c4lh28xv4iagp20ni97cya1f12yg58q0m733qahk8gncb";
fetchcargo = import ./fetchcargo.nix {
inherit stdenv cacert git cargo-vendor;
inherit (rust) cargo;
};
stabilizerDeps = fetchcargo {
name = "stabilizer";
src = ../.;
inherit sha256;
};
in
buildRustPackage rec {
name = "stabilizer";
version = "0.0.0";
src = ../.;
cargoSha256 = sha256;
buildInputs = [ stabilizerDeps ];
patchPhase = ''
cat >> .cargo/config <<EOF
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "${stabilizerDeps}"
EOF
'';
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release
'';
doCheck = false;
installPhase = ''
mkdir -p $out/lib
cp target/thumbv7em-none-eabihf/release/stabilizer $out/lib/
'';
}

View File

@ -1,15 +0,0 @@
# For running on Hydra
{ pkgs ? import <nixpkgs> {},
rustManifest ? ./nix/channel-rust-nightly.toml
}:
with pkgs;
let
stabilizer = callPackage ./default.nix {
inherit rustManifest;
mozillaOverlay = import <mozillaOverlay>;
};
in
{
build = lib.hydraJob stabilizer;
}