Keil Logo

Keil Examples

The STMicroelectronics functions in the STR71X.LIB STR71x Software Library files are written for fast and efficient interrupt handling. They are defined with the standard __irq function attribute of the RealView Compiler as shown below:

// Timer3 IRQ: Executed each 10ms
__irq void T3TIMI_IRQHandler (void) {
  TimeVal++;                              // Increment Tick Counter
  TIM_FlagClear(TIM3, TIM_TO_IT);
  EIC->IPR = 1 << T3TIMI_IRQChannel;

These "Keil-style" interrupt functions have the following requirements and benefits:

  • Disable the configuration option Setup EIC and Exception Handlers in the startup code STR71x.s. This option is only required when you are using the STMicroelectronics specific interrupt handling.
  • Due to hardware restrictions, all interrupt functions must be located within the same 64KB memory block.
  • The Keil-style interrupt functions are faster in execution compared to the STMicroelectronics specific interrupt handling since there is no additional software layer required.
  • The Keil-style interrupt functions do not change the CPU status. Therefore, the interrupt is executed in the Interrupt CPU mode which provides its own stack and avoids interrupt nesting. Interrupt nesting is possible by changing the CPU mode, but we strongly recommend keeping interrupt functions relatively short and using the features of the RTX kernel instead.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.