From a67e12eb1ef2cef763ee654bb55ab2c9112dccc2 Mon Sep 17 00:00:00 2001 From: Andreas Hartmann Date: Wed, 17 Aug 2022 10:17:39 +0200 Subject: [PATCH] cargo: Add rustflag to force frame pointers as required by the [esp-backtrace](https://github.com/esp-rs/esp-backtrace) crate. --- .cargo/config.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 4bbd701..122372b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -8,6 +8,10 @@ runner = "espflash --monitor" [build] {% if mcu == "esp32c3" -%} rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", + "-C", "link-arg=-Tlinkall.x", ] target = "riscv32imac-unknown-none-elf"