make: Set up release profile and update the readme
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Due to limiting the codegen units to 1 the size of the program memory can be reduced roughly by 10% and the data memory by a bit more than 20%.
This commit is contained in:
parent
882e79f9b8
commit
3f19ad6ee9
2 changed files with 62 additions and 1 deletions
|
@ -79,5 +79,6 @@ regulator is 3.3V.
|
|||
### The Rust Firmware
|
||||
To flash the firmware, connect the ICSP pins of the board to the
|
||||
programmer and inside the `firmware/rust/` directory run `cargo make
|
||||
all`. This burns the fuses, writes the default configuration values to
|
||||
--profile release all`. This compiles the firmware with the release
|
||||
profile, burns the fuses, writes the default configuration values to
|
||||
the EEPROM and flashes the firmware.
|
||||
|
|
|
@ -6,35 +6,95 @@ HIGH_FUSE = "0xD6"
|
|||
LOW_FUSE = "0xE2"
|
||||
|
||||
[tasks.size]
|
||||
run_task = [
|
||||
{ name = "size-development", condition = { profiles = [ "development" ] } },
|
||||
{ name = "size-release", condition = { profiles = [ "release" ] } },
|
||||
]
|
||||
|
||||
[tasks.size-development]
|
||||
description = "Print usage of memory segments"
|
||||
dependencies = ["build"]
|
||||
command = "avr-size"
|
||||
args = ["--format=avr", "--mcu=${MCU}", "target/avr-atmega328p/debug/clock-generator.elf"]
|
||||
|
||||
[tasks.size-release]
|
||||
description = "Print usage of memory segments"
|
||||
dependencies = ["build"]
|
||||
command = "avr-size"
|
||||
args = ["--format=avr", "--mcu=${MCU}", "target/avr-atmega328p/release/clock-generator.elf"]
|
||||
|
||||
[tasks.copy_flash]
|
||||
run_task = [
|
||||
{ name = "copy_flash-development", condition = { profiles = [ "development" ] } },
|
||||
{ name = "copy_flash-release", condition = { profiles = [ "release" ] } },
|
||||
]
|
||||
|
||||
[tasks.copy_flash-development]
|
||||
description = "Extract 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.copy_flash-release]
|
||||
description = "Extract the flash"
|
||||
dependencies = ["build"]
|
||||
command = "avr-objcopy"
|
||||
args = ["-O", "ihex", "-j", ".text", "-j", ".data", "target/avr-atmega328p/release/clock-generator.elf", "target/avr-atmega328p/release/clock-generator.hex"]
|
||||
|
||||
[tasks.flash]
|
||||
run_task = [
|
||||
{ name = "flash-development", condition = { profiles = [ "development" ] } },
|
||||
{ name = "flash-release", condition = { profiles = [ "release" ] } },
|
||||
]
|
||||
|
||||
[tasks.flash-development]
|
||||
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.flash-release]
|
||||
description = "Flash the firmware"
|
||||
dependencies = ["copy_flash", "size-release"]
|
||||
command = "avrdude"
|
||||
args = ["-p", "${MCU}", "-c", "${PROGRAMMER}", "-U", "flash:w:target/avr-atmega328p/release/clock-generator.hex:a"]
|
||||
|
||||
[tasks.copy_eeprom]
|
||||
run_task = [
|
||||
{ name = "copy_eeprom-development", condition = { profiles = [ "development" ] } },
|
||||
{ name = "copy_eeprom-release", condition = { profiles = [ "release" ] } },
|
||||
]
|
||||
|
||||
[tasks.copy_eeprom-development]
|
||||
description = "Extract the EEPROM"
|
||||
dependencies = ["build"]
|
||||
command = "avr-objcopy"
|
||||
args = ["--change-section-lma", ".eeprom=0", "-O", "ihex", "-j", ".eeprom", "target/avr-atmega328p/debug/clock-generator.elf", "target/avr-atmega328p/debug/clock-generator.eep"]
|
||||
|
||||
[tasks.copy_eeprom-release]
|
||||
description = "Extract the EEPROM"
|
||||
dependencies = ["build"]
|
||||
command = "avr-objcopy"
|
||||
args = ["--change-section-lma", ".eeprom=0", "-O", "ihex", "-j", ".eeprom", "target/avr-atmega328p/release/clock-generator.elf", "target/avr-atmega328p/release/clock-generator.eep"]
|
||||
|
||||
[tasks.eeprom]
|
||||
run_task = [
|
||||
{ name = "eeprom-development", condition = { profiles = [ "development" ] } },
|
||||
{ name = "eeprom-release", condition = { profiles = [ "release" ] } },
|
||||
]
|
||||
|
||||
[tasks.eeprom-development]
|
||||
description = "Flash the eeprom"
|
||||
dependencies = ["copy_eeprom", "size"]
|
||||
command = "avrdude"
|
||||
args = ["-p", "${MCU}", "-c", "${PROGRAMMER}", "-U", "eeprom:w:target/avr-atmega328p/debug/clock-generator.eep:a"]
|
||||
|
||||
[tasks.eeprom-release]
|
||||
description = "Flash the eeprom"
|
||||
dependencies = ["copy_eeprom", "size"]
|
||||
command = "avrdude"
|
||||
args = ["-p", "${MCU}", "-c", "${PROGRAMMER}", "-U", "eeprom:w:target/avr-atmega328p/release/clock-generator.eep:a"]
|
||||
|
||||
[tasks.fuses]
|
||||
description = "Burn the fuses"
|
||||
command = "avrdude"
|
||||
|
|
Loading…
Reference in a new issue