Skip to content

Commit

Permalink
feat: use flip-link by default
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Oct 21, 2024
1 parent 505eba8 commit 0cc768a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ linker = "ldproxy"
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
{% else -%}
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
linker = "flip-link"
{% endif -%}
{% if microcontroller_family == "rp2040" -%}
runner = "probe-rs run --chip rp2040"
Expand Down
5 changes: 4 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
[tasks.install-llvm-tools]
install_crate = { rustup_component_name = "llvm-tools" }

[tasks.flip-link]
install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["flip-link", "-h"] }

[tasks.objcopy]
install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [
"objcopy",
"--help",
] }
command = "cargo"
args = ["objcopy", "--release", "--", "-O", "ihex", "rmk.hex"]
dependencies = ["install-llvm-tools"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.uf2]
command = "python"
Expand Down
5 changes: 4 additions & 1 deletion Makefile_split.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[tasks.install-llvm-tools]
install_crate = { rustup_component_name = "llvm-tools" }

[tasks.flip-link]
install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["flip-link", "-h"] }

[tasks.objcopy-central]
install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [
"objcopy",
Expand All @@ -17,7 +20,7 @@ args = [
"ihex",
"rmk-central.hex",
]
dependencies = ["install-llvm-tools"]
dependencies = ["install-llvm-tools", "flip-link"]

[tasks.objcopy-peripheral]
install_crate = { crate_name = "cargo-binutils", binary = "cargo", test_arg = [
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Template for initializing a [RMK](https://github.com/HaoboGu/rmk) keyboard firmw

## Usage

1. Install `cargo generate`
1. Install `cargo generate` and `flip-link`

```shell
cargo install cargo-generate
cargo install cargo-generate flip-link
```

2. Create your project using the template
Expand All @@ -20,7 +20,11 @@ Template for initializing a [RMK](https://github.com/HaoboGu/rmk) keyboard firmw
4. (optional) Install [`probe-rs`](https://github.com/probe-rs/probe-rs) for flashing and debugging

```shell
cargo install probe-rs --features cli
# https://probe.rs/docs/getting-started/installation/
# Linux or macOS
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh
# Windows
irm https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.ps1 | iex
```

5. (optional) Build and flash
Expand Down

0 comments on commit 0cc768a

Please sign in to comment.