This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Creating an interrupt function with stm32f303 and ARMCC compiler

Hi all,

I am having difficulty in understanding "interrupts".
I am writing code for a stm32f303 microcontroller using ARMCC in Keil uVision 4 IDE.

After doing a couple of days of reading online and the compiler manual I have created
an interrupt function that looks like this:

////////////////////////////////////////////////////////////////////
__irq void TimerInterrupt(void) // located in the source file
{

.....statements....

}
///////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////
__irq void TimerInterrupt(void); // located in a header file
///////////////////////////////////////////////////////////////////

Now, what I am trying to do overall is to have a interrupt function that will be called
when a timer reaches it's overflow and sets an interrupt bit.

Thankyou in advance if anyone has anything to contribute to this.

Sincerely,
Jim

Parents
  • Hello english isn't my mother language and i'm right now very busy,because of that this explanation was translated by google translator, and i made minor correction to it but i think that you can take the general idea. For further info i suggest that study CMSIS interface and who things are done in the ARM Cortex-M.

    Interrupt handling in these devices is carried out by CMSIS interface in the file <device>startup_.s are defined as all interrupt vectors supported by the device in question, then <device>_it.h and <device>_it.c respectively are declared and implemented the functions that will serve the interruptions, the identifiers of these functions must match those defined in startup_<device>.s file although any function whose declaration appears in the main and match the name defined in the bootfile can serve the interrupt in question, so that they are in <device>_it.c promotes code organization.

Reply
  • Hello english isn't my mother language and i'm right now very busy,because of that this explanation was translated by google translator, and i made minor correction to it but i think that you can take the general idea. For further info i suggest that study CMSIS interface and who things are done in the ARM Cortex-M.

    Interrupt handling in these devices is carried out by CMSIS interface in the file <device>startup_.s are defined as all interrupt vectors supported by the device in question, then <device>_it.h and <device>_it.c respectively are declared and implemented the functions that will serve the interruptions, the identifiers of these functions must match those defined in startup_<device>.s file although any function whose declaration appears in the main and match the name defined in the bootfile can serve the interrupt in question, so that they are in <device>_it.c promotes code organization.

Children