diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 0f6ac59..0000000 --- a/flake.lock +++ /dev/null @@ -1,127 +0,0 @@ -{ - "nodes": { - "crane": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1683505101, - "narHash": "sha256-VBU64Jfu2V4sUR5+tuQS9erBRAe/QEYUxdVMcJGMZZs=", - "owner": "ipetkov", - "repo": "crane", - "rev": "7b5bd9e5acb2bb0cfba2d65f34d8568a894cdb6c", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1684120848, - "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1684117262, - "narHash": "sha256-ZSF4CZqeyk6QwTjal73KPMuTWiU6w/p8ygEimrPb7u4=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "4679872d2dd3e94ffef75efcbf77ea11549d90a7", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 977257e..0000000 --- a/flake.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ - description = "Neotron BMC"; - - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - crane = { - url = "github:ipetkov/crane"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - rust-overlay.follows = "rust-overlay"; - }; - }; - }; - - outputs = { self, nixpkgs, flake-utils, rust-overlay, crane }: - let - # List of systems this flake.nix has been tested to work with - systems = [ "x86_64-linux" ]; - pkgsForSystem = system: nixpkgs.legacyPackages.${system}.appendOverlays [ - rust-overlay.overlays.default - ]; - in - flake-utils.lib.eachSystem systems - (system: - let - pkgs = pkgsForSystem system; - toolchain = pkgs.rust-bin.stable.latest.default.override { - targets = [ "thumbv6m-none-eabi" ]; - }; - craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; - - bmc-pico = craneLib.mkCargoDerivation { - pname = "neotron-bmc-pico"; - version = (craneLib.crateNameFromCargoToml { - cargoToml = ./neotron-bmc-pico/Cargo.toml; - }).version; - cargoArtifacts = null; - cargoVendorDir = craneLib.vendorCargoDeps { src = ./neotron-bmc-pico; }; - src = with pkgs.lib; - let keep = suffixes: path: type: any (s: hasSuffix s path) suffixes; - in - cleanSourceWith { - src = craneLib.path ./.; - filter = path: type: any id (map (f: f path type) [ - craneLib.filterCargoSources - (keep [ - ".md" # neotron-bmc-protocol needs README.md - ".x" - ]) - ]); - }; - buildPhaseCargoCommand = '' - cd neotron-bmc-pico # because .cargo/config.toml exists here - cargo build --release --target=thumbv6m-none-eabi - ''; - nativeBuildInputs = [ - pkgs.makeWrapper - pkgs.probe-run - pkgs.flip-link - ]; - installPhase = '' - mkdir -p $out/bin - cp target/thumbv6m-none-eabi/release/neotron-bmc-pico $out/bin/ - makeWrapper ${pkgs.probe-run}/bin/probe-run $out/bin/flash-neotron-bmc-pico \ - --set DEFMT_LOG info \ - --add-flags "--chip STM32F030K6Tx $out/bin/neotron-bmc-pico" - ''; - }; - in rec - { - packages.neotron-bmc-pico = bmc-pico; - defaultPackage = packages.neotron-bmc-pico; - - defaultApp = apps.neotron-bmc-pico; - apps.neotron-bmc-pico = flake-utils.lib.mkApp { - drv = bmc-pico; - exePath = "/bin/flash-neotron-bmc-pico"; - }; - - devShell = pkgs.mkShell { - nativeBuildInputs = [ - toolchain - pkgs.probe-run - pkgs.flip-link - ]; - }; - } - ); -} diff --git a/neotron-bmc-nucleo/.cargo/config.toml b/neotron-bmc-nucleo/.cargo/config.toml index ad919e4..24e174e 100644 --- a/neotron-bmc-nucleo/.cargo/config.toml +++ b/neotron-bmc-nucleo/.cargo/config.toml @@ -1,5 +1,5 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip STM32F401RETx" +runner = "probe-rs run --chip STM32F401RETx" rustflags = [ "-C", "linker=flip-link", "-C", "link-arg=-Tlink.x", diff --git a/neotron-bmc-nucleo/README.md b/neotron-bmc-nucleo/README.md index 4196115..4395603 100644 --- a/neotron-bmc-nucleo/README.md +++ b/neotron-bmc-nucleo/README.md @@ -48,10 +48,10 @@ This firmware runs on an ST Nucleo-F401RE, for development and debugging purpose - see https://www.rust-lang.org 2. The `thumbv7em-none-eabi` target - run `rustup target add target=thumbv7em-none-eabi` -3. `probe-run` - - run `cargo install probe-run` from your `$HOME` dir (not this folder!) +3. `probe-rs` + - See 4. `flip-link` - - run `cargo install flip-link` from your `$HOME` dir (not this folder!) + - run `cargo install flip-link` Then to build and flash, connect a probe supported by probe-rs (such as a SEGGER J-Link, or an ST-Link) and run: diff --git a/neotron-bmc-nucleo/src/lib.rs b/neotron-bmc-nucleo/src/lib.rs index b7be7c1..a3ea07a 100644 --- a/neotron-bmc-nucleo/src/lib.rs +++ b/neotron-bmc-nucleo/src/lib.rs @@ -23,7 +23,7 @@ defmt::timestamp!("{=usize}", { n }); -/// Terminates the application and makes `probe-run` exit with exit-code = 0 +/// Terminates the application and makes `probe-rs` exit with exit-code = 0 pub fn exit() -> ! { loop { cortex_m::asm::bkpt(); diff --git a/neotron-bmc-pico/.cargo/config.toml b/neotron-bmc-pico/.cargo/config.toml index f398624..f981e19 100644 --- a/neotron-bmc-pico/.cargo/config.toml +++ b/neotron-bmc-pico/.cargo/config.toml @@ -1,5 +1,5 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip STM32F030K6Tx" +runner = "probe-rs run --chip STM32F030K6Tx" rustflags = [ "-C", "linker=flip-link", "-C", "link-arg=-Tlink.x", diff --git a/neotron-bmc-pico/README.md b/neotron-bmc-pico/README.md index 40dafbd..bb1e877 100644 --- a/neotron-bmc-pico/README.md +++ b/neotron-bmc-pico/README.md @@ -65,8 +65,8 @@ The SPI interface runs in SPI mode 0 (clock line idles low, data sampled on risi * see https://www.rust-lang.org 2. The `thumbv6m-none-eabi` target * run `rustup target add thumbv6m-none-eabi` -3. `probe-run` - * run `cargo install probe-run` +3. `probe-rs` + * See 4. `flip-link` * run `cargo install flip-link` diff --git a/neotron-bmc-pico/src/lib.rs b/neotron-bmc-pico/src/lib.rs index 661dcc5..ecca6c7 100644 --- a/neotron-bmc-pico/src/lib.rs +++ b/neotron-bmc-pico/src/lib.rs @@ -25,7 +25,7 @@ defmt::timestamp!("{=usize}", { n }); -/// Terminates the application and makes `probe-run` exit with exit-code = 0 +/// Terminates the application and makes `probe-rs` exit with exit-code = 0 pub fn exit() -> ! { loop { cortex_m::asm::bkpt();