fixed properly
This commit is contained in:
23
flake.nix
23
flake.nix
@@ -6,6 +6,10 @@
|
||||
outputs = { self, nixpkgs }: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
rust = pkgs.rust-bin.stable.latest.default.override {
|
||||
targets = [ "thumbv8m.main-none-eabihf" ];
|
||||
extensions = [ "rust-src" "rustfmt" "clippy" ];
|
||||
};
|
||||
in {
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
@@ -34,25 +38,28 @@
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
# Set up Rust target
|
||||
rustup target add thumbv7em-none-eabihf 2>/dev/null || true
|
||||
echo ">>> STM32 DevShell"
|
||||
|
||||
# Ensure probe-rs binary is in PATH
|
||||
if ! command -v probe-rs >/dev/null; then
|
||||
echo "⚠️ probe-rs not found! (check nix installation)"
|
||||
fi
|
||||
export PATH=${pkgs.rust-analyzer}/bin:$PATH
|
||||
export PATH=$HOME/.cargo/bin:$PATH
|
||||
|
||||
export RUST_TARGET=thumbv7em-none-eabihf
|
||||
rustup default stable
|
||||
rustup component add rust-src rustfmt clippy 2>/dev/null || true
|
||||
rustup target add thumbv8m.main-none-eabihf 2>/dev/null || true
|
||||
|
||||
export RUST_TARGET=thumbv8m.main-none-eabihf
|
||||
export CARGO_TARGET_DIR=target
|
||||
export DEFMT_LOG=info
|
||||
export PATH=$PATH:${pkgs.gcc-arm-embedded}/bin
|
||||
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/library"
|
||||
|
||||
rustc --version
|
||||
arm-none-eabi-gcc --version | head -n1
|
||||
echo "cargo build --release --target thumbv8m.main-none-eabihf"
|
||||
echo "cargo flash --release --chip STM32U575ZI"
|
||||
echo "export DEFMT_LOG=info"
|
||||
echo "cargo run --bin main"
|
||||
echo "probe-rs run --chip STM32U575ZITxQ target/thumbv8m.main-none-eabihf/release/main"
|
||||
echo "target/**/build/embassy-stm32-*/out/_generated.rs"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user