esp-rs / embuild

Build support for embedded Rust: Cargo integration with other embedded build ecosystems & tools, like PlatformIO, CMake and kconfig.
Apache License 2.0
135 stars 38 forks source link

Defmt library need some linking #67

Closed farbodpm closed 3 months ago

farbodpm commented 1 year ago

Hi I have issue with adding defmt library to my code. I added defmt to my toml in both build dependencies and dependencies. Also add '"-C", "link-arg=-Tdefmt.x"' to rust flags. I faced this problem


          Stack backtrace:
             0: ldproxy::main
             1: std::sys_common::backtrace::__rust_begin_short_backtrace
             2: std::rt::lang_start::{{closure}}
             3: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:280:13
                std::panicking::try::do_call
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
                std::panicking::try
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
                std::panic::catch_unwind
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
                std::rt::lang_start_internal::{{closure}}
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:48
                std::panicking::try::do_call
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
                std::panicking::try
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
                std::panic::catch_unwind
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
                std::rt::lang_start_internal
                       at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:20
             4: main
             5: <unknown>
             6: __libc_start_main
             7: _start

also full error is here

Vollbrecht commented 3 months ago

We still don't have defmt automatically integrated in our downstream crates, but defmt works for me with current esp-idf-template and added Tdefmt.x if i use it manually.

Closing this, if anybody runs into related problems feel free to reopen/add to here.