Since rust v1.74, the linker can be selected without using rustflags. This plays nicer with `RUSTFLAGS`.
36 lines
1.1 KiB
TOML
36 lines
1.1 KiB
TOML
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
|
# Choose a default "cargo run" tool (see README for more info)
|
|
# - `probe-rs` provides flashing and defmt via a hardware debugger, and stack unwind on panic
|
|
# - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode
|
|
# runner = "probe-rs run --chip RP2040 --protocol swd"
|
|
# runner = "elf2uf2-rs -d"
|
|
{% case flash_method -%}
|
|
{%- when "probe-rs" -%}
|
|
runner = "probe-rs run --chip RP2040 --protocol swd"
|
|
{%- when "elf2uf2-rs" -%}
|
|
runner = "elf2uf2-rs -d"
|
|
{%- when "none" -%}
|
|
{%- else -%}
|
|
{%- if flash_method != "" -%}
|
|
runner = "{{ flash_method_custom }}"
|
|
{%- endif -%}
|
|
{%- endcase %}
|
|
linker = "flip-link"
|
|
rustflags = [
|
|
"-C", "link-arg=--nmagic",
|
|
"-C", "link-arg=-Tlink.x",
|
|
"-C", "link-arg=-Tdefmt.x",
|
|
|
|
# Code-size optimizations.
|
|
# trap unreachable can save a lot of space, but requires nightly compiler.
|
|
# uncomment the next line if you wish to enable it
|
|
# "-Z", "trap-unreachable=no",
|
|
"-C", "no-vectorize-loops",
|
|
]
|
|
|
|
[build]
|
|
target = "thumbv6m-none-eabi"
|
|
|
|
[env]
|
|
DEFMT_LOG = "debug"
|