forked from M-Labs/humpback-dds
Compare commits
2 Commits
master
...
e38bf09c26
Author | SHA1 | Date | |
---|---|---|---|
e38bf09c26 | |||
36bd30ff83 |
@ -14,7 +14,7 @@ stm32h7xx-hal = {version = "0.7.1", features = [ "stm32h743v", "rt", "unproven",
|
|||||||
smoltcp = { version = "0.6.0", default-features = false, features = [ "ethernet", "proto-ipv4", "proto-ipv6", "socket-tcp" ] }
|
smoltcp = { version = "0.6.0", default-features = false, features = [ "ethernet", "proto-ipv4", "proto-ipv6", "socket-tcp" ] }
|
||||||
nb = "1.0.0"
|
nb = "1.0.0"
|
||||||
embedded-nal = "0.1.0"
|
embedded-nal = "0.1.0"
|
||||||
minimq = { git = "https://github.com/quartiq/minimq.git", branch = "master" }
|
minimq = { version = "0.1.0", git = "https://github.com/quartiq/minimq.git" }
|
||||||
heapless = "0.5.6"
|
heapless = "0.5.6"
|
||||||
nom = { version = "5.1.2", default-features = false, features = [] }
|
nom = { version = "5.1.2", default-features = false, features = [] }
|
||||||
ryu = "1.0"
|
ryu = "1.0"
|
||||||
|
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"mozilla-overlay": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638887313,
|
||||||
|
"narHash": "sha256-FMYV6rVtvSIfthgC1sK1xugh3y7muoQcvduMdriz4ag=",
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"rev": "7c1e8b1dd6ed0043fb4ee0b12b815256b0b9de6f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1642348879,
|
||||||
|
"narHash": "sha256-ReoDCqqqGEQBmQHlQAXSLSk4LGO96HhBtxsF1TpOnLU=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "8a70a6808c884282161bd77706927caeac0c11e8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-21.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"mozilla-overlay": "mozilla-overlay",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"src-migen": "src-migen"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src-migen": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1639659493,
|
||||||
|
"narHash": "sha256-qpVj/yJf4hDDc99XXpVPH4EbLC8aCmEtACn5qNc3DGI=",
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "migen",
|
||||||
|
"rev": "ac703010eaa06ac9b6e32f97c6fa98b15de22b31",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "m-labs",
|
||||||
|
"repo": "migen",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
98
flake.nix
Normal file
98
flake.nix
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
description = "Firmware for MQTT-controlled 4-channel DDS signal generator using Urukul, Humpback and STM32 NUCLEO.";
|
||||||
|
|
||||||
|
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
|
||||||
|
inputs.mozilla-overlay = { url = github:mozilla/nixpkgs-mozilla; flake = false; };
|
||||||
|
inputs.src-migen = { url = github:m-labs/migen; flake = false; };
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, mozilla-overlay, src-migen }:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (import mozilla-overlay) ]; };
|
||||||
|
rustManifest = pkgs.fetchurl {
|
||||||
|
url = "https://static.rust-lang.org/dist/2020-10-30/channel-rust-nightly.toml";
|
||||||
|
sha256 = "0iygcwzh8s0lfdghj5809krvzifc1ii1wm4sd3qqn7s0rz1s14hi";
|
||||||
|
};
|
||||||
|
|
||||||
|
migen = pkgs.python3Packages.buildPythonPackage rec {
|
||||||
|
name = "migen";
|
||||||
|
src = src-migen;
|
||||||
|
propagatedBuildInputs = [ pkgs.python3Packages.colorama ];
|
||||||
|
};
|
||||||
|
|
||||||
|
targets = [
|
||||||
|
"thumbv7em-none-eabihf"
|
||||||
|
];
|
||||||
|
rustChannelOfTargets = _channel: _date: targets:
|
||||||
|
(pkgs.lib.rustLib.fromManifestFile rustManifest {
|
||||||
|
inherit (pkgs) stdenv lib fetchurl patchelf;
|
||||||
|
}).rust.override {
|
||||||
|
inherit targets;
|
||||||
|
extensions = ["rust-src"];
|
||||||
|
};
|
||||||
|
rust = rustChannelOfTargets "nightly" null targets;
|
||||||
|
rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
|
||||||
|
rustc = rust;
|
||||||
|
cargo = rust;
|
||||||
|
});
|
||||||
|
|
||||||
|
humpback-dds = rustPlatform.buildRustPackage rec {
|
||||||
|
name = "humpback-dds";
|
||||||
|
version = "0.0.0";
|
||||||
|
|
||||||
|
src = self;
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = ./Cargo.lock;
|
||||||
|
outputHashes = {
|
||||||
|
"SaiTLS-0.1.0" = "sha256-T3hyASQGZAXGLKfOB3mh33VrvRlYSMc1CJdX4XvDFrQ=";
|
||||||
|
"rsa-0.3.0" = "sha256-9X2kDAOu0HG94HhwYoUtX/ezq99w7u95XMzn3h/JUwk=";
|
||||||
|
"minimq-0.1.0" = "sha256-yPqMAwyusZZW7571Jn3QVYK2jqmuSMNU6LiZXRYAGGM=";
|
||||||
|
"smoltcp-0.6.0" = "sha256-BCqcphWF3AotQfuIFYhDiWIMhh2eUCuqD4MPz4dASQ4=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs.llvm
|
||||||
|
pkgs.yosys
|
||||||
|
pkgs.nextpnr
|
||||||
|
pkgs.icestorm
|
||||||
|
(pkgs.python3.withPackages(ps: [ migen ]))
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
cargo build --release --bin humpback-dds
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out $out/nix-support
|
||||||
|
cp target/thumbv7em-none-eabihf/release/humpback-dds $out/humpback-dds.elf
|
||||||
|
echo file binary-dist $out/humpback-dds.elf >> $out/nix-support/hydra-build-products
|
||||||
|
llvm-objcopy -O binary target/thumbv7em-none-eabihf/release/humpback-dds $out/humpback-dds.bin
|
||||||
|
echo file binary-dist $out/humpback-dds.bin >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
dontFixup = true;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages.x86_64-linux = {
|
||||||
|
inherit humpback-dds;
|
||||||
|
};
|
||||||
|
|
||||||
|
hydraJobs = {
|
||||||
|
inherit humpback-dds;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShell.x86_64-linux = pkgs.mkShell {
|
||||||
|
name = "humpback-dds-dev-shell";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
rustPlatform.rust.rustc
|
||||||
|
rustPlatform.rust.cargo
|
||||||
|
openocd dfu-util
|
||||||
|
yosys nextpnr icestorm
|
||||||
|
] ++ (with python3Packages; [
|
||||||
|
numpy matplotlib migen
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
defaultPackage.x86_64-linux = humpback-dds;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user