From 7c4eb8e7703f6f193f56a056d844c3a25703ba91 Mon Sep 17 00:00:00 2001 From: Harry Ho Date: Thu, 17 Sep 2020 12:49:22 +0800 Subject: [PATCH] stm32: generate memory image from elf for dfu bootloader to download --- stm32/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stm32/default.nix b/stm32/default.nix index aabccad..ccf6140 100644 --- a/stm32/default.nix +++ b/stm32/default.nix @@ -20,6 +20,7 @@ let cargoSha256 = (import cargoSha256Drv); inherit patchPhase; + buildInputs = [ pkgs.llvm ]; buildPhase = '' export CARGO_HOME=$(mktemp -d cargo-home.XXX) cargo build --release @@ -30,6 +31,8 @@ let mkdir -p $out $out/nix-support cp target/thumbv7em-none-eabihf/release/${name} $out/${name}.elf echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products + llvm-objcopy -O binary target/thumbv7em-none-eabihf/release/${name} $out/${name}.bin + echo file binary-dist $out/${name}.bin >> $out/nix-support/hydra-build-products ''; }; in