Use rust-objcopy instead of llvm-objcopy

This uses rust's own llvm version
update-nix
atse 2024-01-17 14:53:59 +08:00
parent 631a10938d
commit 82e27b1234
2 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,7 @@ There are several options for flashing Thermostat. DFU requires only a micro-USB
### dfu-util on Linux
* Install the DFU USB tool (dfu-util).
* Convert firmware from ELF to BIN: `arm-none-eabi-objcopy -O binary thermostat thermostat.bin` (you can skip this step if using the BIN from Hydra)
* Convert firmware from ELF to BIN: `rust-objcopy -O binary target/thumbv7em-none-eabihf/release/thermostat thermostat.bin` (you can skip this step if using the BIN from Hydra)
* Connect to the Micro USB connector to Thermostat below the RJ45.
* Add jumper to Thermostat v2.0 across 2-pin jumper adjacent to JTAG connector.
* Cycle board power to put it in DFU update mode

View File

@ -39,7 +39,7 @@
};
};
nativeBuildInputs = [ pkgs.llvm ];
nativeBuildInputs = [ pkgs.cargo-binutils ];
buildPhase = ''
cargo build --release --bin thermostat
@ -49,7 +49,7 @@
mkdir -p $out $out/nix-support
cp target/thumbv7em-none-eabihf/release/thermostat $out/thermostat.elf
echo file binary-dist $out/thermostat.elf >> $out/nix-support/hydra-build-products
llvm-objcopy -O binary target/thumbv7em-none-eabihf/release/thermostat $out/thermostat.bin
rust-objcopy -O binary target/thumbv7em-none-eabihf/release/thermostat $out/thermostat.bin
echo file binary-dist $out/thermostat.bin >> $out/nix-support/hydra-build-products
'';
@ -67,7 +67,8 @@
devShell.x86_64-linux = pkgs.mkShell {
name = "thermostat-dev-shell";
buildInputs = with pkgs; [
rust openocd dfu-util
rust cargo-binutils
openocd dfu-util
] ++ (with python3Packages; [
numpy matplotlib
]);