embedded-alloc icon indicating copy to clipboard operation
embedded-alloc copied to clipboard

Is there anyway to use panic_semihosting with this crate?

Open ebakoba opened this issue 4 years ago • 1 comments

Every example declares its own #[panic_handler] function.

When I use only panic_semihosting crate, I get an error stating:

  = note: arm-none-eabi-ld: /home/pi/.rustup/toolchains/nightly-armv7-unknown-linux-gnueabihf/lib/rustlib/thumbv7m-none-eabi/lib/libcore-c83b634e1f0ecbbe.rlib(core-c83b634e1f0ecbbe.core.2smtzb3g-cgu.0.rcgu.o): in function `core::panicking::panic_fmt':
          /rustc/043eca7f0b34d12e61c44206beca740628647080//library/core/src/panicking.rs:85: undefined reference to `rust_begin_unwind'

If I use both on the same time, I obviously get the duplicate error.

Right now, I have only been able to succeed with self-decleared panic-handler function.

ebakoba avatar Oct 18 '20 15:10 ebakoba

I think the example declares its own panic_handler to avoid pulling in more dependencies, you don't need to define it yourself for this crate to work.

thalesfragoso avatar Dec 31 '20 20:12 thalesfragoso