You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unclear how to use #[interrupt] macro without deprecated --reexport-interrupt flag #830
According to the documentation of svd2rust, the --reexport-interrupt flag is deprecated. However according to the documentation of cortex-m-rt, the #[interrupt] macro should only be used via the svd2rust reexport, and indeed it fails to compile when used directly, with a confusing error.
How is the interrupt macro supposed to be used without the --reexport-interrupt flag passed to svd2rust? This should at least be documented clearly in the svd2rust documentation.
If you are trying to use this with rtic and come across some linker errors regarding the interrupt vector table, e.g. link.x:49: symbol not found: DefaultHandler_:
Make sure to include the import to use cortex_m_rt::interrupt;. I thought rtic would do that by itself, but apparently it doesn't.
Activity
burrbull commentedon Mar 26, 2024
There have been planned some changes in
cortex-m-rt0.8 like movinginterruptin independent crate. But it is not done yet.Ask @adamgreig.
robamu commentedon Jun 25, 2024
I also stumbled into the issue, wondering why I could not use the
interruptmacro, and I had to rebuild with the--reexport-interruptflag.royb3 commentedon Aug 14, 2024
You can use it without the flag. But you have to import your PAC's Interrupt enum as
interrupt.That's basically what the
--reexport-interruptflag does as well. Not sure if there's any value in doing this over using the deprecated flag for now.Bnyro commentedon Apr 13, 2026
To save any future reader time with debugging:
If you are trying to use this with rtic and come across some linker errors regarding the interrupt vector table, e.g.
link.x:49: symbol not found: DefaultHandler_:Make sure to include the import to
use cortex_m_rt::interrupt;. I thoughtrticwould do that by itself, but apparently it doesn't.E.g., this would look like
Details
For reference, that's what
--reexport-interruptdoes:Sorry if this looks obvious to most of you, but understanding this earlier would have probably saved me hours :)