fw-rust: Add a makefile for cargo-make
It has to be decided what kind of tooling should be used, for now cargo-make is used. This will probably be changed to use the tools provided by [probe.rs](https://probe.rs).
This commit is contained in:
parent
aa75712418
commit
d2772291bf
1 changed files with 29 additions and 0 deletions
29
firmware/rust/Makefile.toml
Normal file
29
firmware/rust/Makefile.toml
Normal file
|
@ -0,0 +1,29 @@
|
|||
[env]
|
||||
MCU = "atmega328p"
|
||||
PROGRAMMER = "usbasp"
|
||||
EXTENDED_FUSE = "0xFF"
|
||||
HIGH_FUSE = "0xD6"
|
||||
LOW_FUSE = "0xE2"
|
||||
|
||||
[tasks.size]
|
||||
description = "Print usage of memory segments"
|
||||
dependencies = ["build"]
|
||||
command = "avr-size"
|
||||
args = ["--format=avr", "--mcu=${MCU}", "target/avr-atmega328p/debug/clock-generator.elf"]
|
||||
|
||||
[tasks.copy_flash]
|
||||
description = "Copy the flash"
|
||||
dependencies = ["build"]
|
||||
command = "avr-objcopy"
|
||||
args = ["-O", "ihex", "-j", ".text", "-j", ".data", "target/avr-atmega328p/debug/clock-generator.elf", "target/avr-atmega328p/debug/clock-generator.hex"]
|
||||
|
||||
[tasks.flash]
|
||||
description = "Flash the firmware"
|
||||
dependencies = ["copy_flash", "size"]
|
||||
command = "avrdude"
|
||||
args = ["-p", "${MCU}", "-c", "${PROGRAMMER}", "-U", "flash:w:target/avr-atmega328p/debug/clock-generator.hex:a"]
|
||||
|
||||
[tasks.fuses]
|
||||
description = "Burn the fuses"
|
||||
command = "avrdude"
|
||||
args = ["-p", "${MCU}", "-c", "${PROGRAMMER}", "-U", "efuse:w:${EXTENDED_FUSE}:m", "-U", "hfuse:w:${HIGH_FUSE}:m", "-U", "lfuse:w:${LOW_FUSE}:m"]
|
Loading…
Reference in a new issue