diff --git a/flake.nix b/flake.nix index e09ece8..074c5ea 100644 --- a/flake.nix +++ b/flake.nix @@ -116,6 +116,19 @@ environment.systemPackages = [ linien-server ]; }); + fast-servo-init = ({ config, pkgs, lib, ... }: { + boot.postBootCommands = lib.mkAfter '' + + # Program the FPGA + set +x + echo Flashing bitstream... + echo 0 > /sys/class/fpga_manager/fpga0/flags + mkdir -p /lib/firmware + cp ${fast-servo-gateware}/gateware.bin /lib/firmware/ + echo gateware.bin > /sys/class/fpga_manager/fpga0/firmware + ''; + }); + gnu-platform = "arm-none-eabi"; binutils-pkg = { zlib, extraConfigureFlags ? [] }: pkgs.stdenv.mkDerivation rec { @@ -295,7 +308,8 @@ inherit nixpkgs; extraModules = [ "${patched-not-os}/zynq_image.nix" - ] ++ pkgs.lib.optional (board == "fast-servo") fast-servo-extrapkg; + ] ++ pkgs.lib.optional (board == "fast-servo") fast-servo-extrapkg + ++ pkgs.lib.optional (board == "fast-servo") fast-servo-init; system = "x86_64-linux"; crossSystem.system = "armv7l-linux"; });