Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.thumbv6m-none-eabi]
runner = "probe-rs run --chip RP2040"

[target.thumbv7em-none-eabihf]
runner = "probe-rs run --chip nRF52840_xxAA"
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
files: |
*.uf2
*.hex
*-memory.x
rmk-boot-nrf52840.elf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 92 additions & 32 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,135 @@ install_crate = { rustup_component_name = "llvm-tools" }
[tasks.flip-link]
install_crate = { crate_name = "flip-link", binary = "flip-link", test_arg = ["-h"] }

[tasks.build-2mb]
[tasks.build-rp2040-2mb]
command = "cargo"
args = ["build", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-2mb"]

[tasks.build-4mb]
[tasks.copy-x-rp2040-2mb]
dependencies = ["build-rp2040-2mb"]
script = [
'''
if [ ! -f rmk-memory.x ]; then
touch build.rs
cargo build --release --target thumbv6m-none-eabi --features rp2040-2mb
fi
cp rmk-memory.x rmk-rp2040-2mb-memory.x
'''
]

[tasks.build-rp2040-4mb]
command = "cargo"
args = ["build", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-4mb"]

[tasks.build-8mb]
[tasks.copy-x-rp2040-4mb]
dependencies = ["build-rp2040-4mb"]
script = [
'''
if [ ! -f rmk-memory.x ]; then
touch build.rs
cargo build --release --target thumbv6m-none-eabi --features rp2040-4mb
fi
cp rmk-memory.x rmk-rp2040-4mb-memory.x
'''
]

[tasks.build-rp2040-8mb]
command = "cargo"
args = ["build", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-8mb"]

[tasks.build-16mb]
[tasks.copy-x-rp2040-8mb]
dependencies = ["build-rp2040-8mb"]
script = [
'''
if [ ! -f rmk-memory.x ]; then
touch build.rs
cargo build --release --target thumbv6m-none-eabi --features rp2040-8mb
fi
cp rmk-memory.x rmk-rp2040-8mb-memory.x
'''
]

[tasks.build-rp2040-16mb]
command = "cargo"
args = ["build", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-16mb"]

[tasks.objcopy-2mb]
dependencies = ["install-llvm-tools", "build-2mb"]
[tasks.copy-x-rp2040-16mb]
dependencies = ["build-rp2040-16mb"]
script = [
'''
if [ ! -f rmk-memory.x ]; then
touch build.rs
cargo build --release --target thumbv6m-none-eabi --features rp2040-16mb
fi
cp rmk-memory.x rmk-rp2040-16mb-memory.x
'''
]

[tasks.build-nrf52840]
command = "cargo"
args = ["build", "--release", "--target", "thumbv7em-none-eabihf", "--features", "nrf52840"]

[tasks.copy-x-nrf52840]
dependencies = ["build-nrf52840"]
script = [
'''
if [ ! -f rmk-memory.x ]; then
touch build.rs
cargo build --release --target thumbv7em-none-eabihf --features nrf52840
fi
cp rmk-memory.x rmk-nrf52840-memory.x
'''
]

[tasks.objcopy-rp2040-2mb]
dependencies = ["install-llvm-tools", "build-rp2040-2mb"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-2mb", "--", "-O", "ihex", "rmk-boot-rp2040-2mb.hex"]

[tasks.objcopy-4mb]
dependencies = ["install-llvm-tools", "build-4mb"]
[tasks.objcopy-rp2040-4mb]
dependencies = ["install-llvm-tools", "build-rp2040-4mb"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-4mb", "--", "-O", "ihex", "rmk-boot-rp2040-4mb.hex"]

[tasks.objcopy-8mb]
dependencies = ["install-llvm-tools", "build-8mb"]
[tasks.objcopy-rp2040-8mb]
dependencies = ["install-llvm-tools", "build-rp2040-8mb"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-8mb", "--", "-O", "ihex", "rmk-boot-rp2040-8mb.hex"]

[tasks.objcopy-16mb]
dependencies = ["install-llvm-tools", "build-16mb"]
[tasks.objcopy-rp2040-16mb]
dependencies = ["install-llvm-tools", "build-rp2040-16mb"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv6m-none-eabi", "--features", "rp2040-16mb", "--", "-O", "ihex", "rmk-boot-rp2040-16mb.hex"]

[tasks.uf2-2mb]
dependencies = ["objcopy-2mb"]
[tasks.objcopy-nrf52840]
dependencies = ["install-llvm-tools", "build-nrf52840"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv7em-none-eabihf", "--features", "nrf52840", "--", "-O", "ihex", "rmk-boot-nrf52840.hex"]

[tasks.uf2-rp2040-2mb]
dependencies = ["copy-x-rp2040-2mb", "objcopy-rp2040-2mb"]
command = "cargo"
args = ["hex-to-uf2", "--input-path", "rmk-boot-rp2040-2mb.hex", "--output-path", "rmk-boot-rp2040-2mb.uf2", "--family", "rp2040"]

[tasks.uf2-4mb]
dependencies = ["objcopy-4mb"]
[tasks.uf2-rp2040-4mb]
dependencies = ["copy-x-rp2040-4mb", "objcopy-rp2040-4mb"]
command = "cargo"
args = ["hex-to-uf2", "--input-path", "rmk-boot-rp2040-4mb.hex", "--output-path", "rmk-boot-rp2040-4mb.uf2", "--family", "rp2040"]

[tasks.uf2-8mb]
dependencies = ["objcopy-8mb"]
[tasks.uf2-rp2040-8mb]
dependencies = ["copy-x-rp2040-8mb", "objcopy-rp2040-8mb"]
command = "cargo"
args = ["hex-to-uf2", "--input-path", "rmk-boot-rp2040-8mb.hex", "--output-path", "rmk-boot-rp2040-8mb.uf2", "--family", "rp2040"]

[tasks.uf2-16mb]
dependencies = ["objcopy-16mb"]
[tasks.uf2-rp2040-16mb]
dependencies = ["copy-x-rp2040-16mb", "objcopy-rp2040-16mb"]
command = "cargo"
args = ["hex-to-uf2", "--input-path", "rmk-boot-rp2040-16mb.hex", "--output-path", "rmk-boot-rp2040-16mb.uf2", "--family", "rp2040"]

[tasks.build-nrf]
command = "cargo"
args = ["build", "--release", "--target", "thumbv7em-none-eabihf", "--features", "nrf52840"]

[tasks.objcopy-nrf]
dependencies = ["install-llvm-tools", "build-nrf"]
command = "cargo"
args = ["objcopy", "--release", "--target", "thumbv7em-none-eabihf", "--features", "nrf52840", "--", "-O", "ihex", "rmk-boot-nrf52840.hex"]

[tasks.uf2-nrf]
dependencies = ["objcopy-nrf"]
[tasks.uf2-nrf52840]
dependencies = ["copy-x-nrf52840", "objcopy-nrf52840"]
command = "cargo"
args = ["hex-to-uf2", "--input-path", "rmk-boot-nrf52840.hex", "--output-path", "rmk-boot-nrf52840.uf2", "--family", "nrf52840"]

[tasks.uf2-all]
dependencies = ["uf2-2mb", "uf2-4mb", "uf2-8mb", "uf2-16mb", "uf2-nrf"]
dependencies = ["uf2-rp2040-2mb", "uf2-rp2040-4mb", "uf2-rp2040-8mb", "uf2-rp2040-16mb", "uf2-nrf52840"]
Loading