This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

interrupts intrinsics using ARM CC 4.5.2 not recognized

as documented in section 6.7.2 of the TI ARM compiler manual, i'm using the intrinsics _disable_interrupts(), etc within my source code....  when i compile, however, the compiler issues a warning about an implictly-defined functions -- suggesting the intrinsics are somehow not being recognized....

i am compiling my sources for cortex-m3 using the TI ABI  (-mv7M3 --abi=ti_arm9_abi); i had similar problems when using ELF....

what i am missing here???  do i need to include some header???  or are these intrinsics not support on cortext-m3???  or is there some other way (from C) to disable/enable/restore interrupts???

  • Those intrinsics are not supported when building for Thumb or Thumb2.  Note Thumb2 is the only mode supported on Cortex-M3.  Your best option is to call assembly routines for disabling and enabling interrupts.  I know folks also do it with with asm() statements, but those tend to cause as many problems as they solve.  The documentation should mention this detail.

    Thanks and regards,

    -George

     

  • i'm interested in minimizing the overhead of calling an asm function, which itself then executes 1-2 instructions....  the older _{disable,enable,restore}_interrupts() intrinsics did not incur such overhead...

    is there a (clean) way to achieve this with asm statements???  gcc handles this nicely by effectively allowing asm statements to reference registers holding C variables in the surrounding context; auto-inlining then works as expected.

  • I encourage folks to avoid asm statements whenever possible.  I also understand wanting to avoid the overhead of a function call. Thus, I concede that asm statements could be a good option for this case.  Just be sure those statements only access the interrupt enable bit (or bits?), and not any C variables, registers the compiler uses, or other elements of the C runtime environment.

    The TI compiler does not support gcc-style asm statements.

    Thanks and regards,

    -George