cancel
Showing results for 
Search instead for 
Did you mean: 

interupts

per3
Associate II
Posted on January 30, 2008 at 17:00

interupts

6 REPLIES 6
per3
Associate II
Posted on May 17, 2011 at 12:22

I have ride 7, and with it a load of examples came.

I have successfully tried my own example with EXTI1_IRQHandler.

To get it to work, one has to call EXTI_init, set EXTI1_IRQChannel with NVIC_Init.

Since I got it to work, I am happy. However, I would like to understand how the compliler knows that EXTI1_IRQHandler is the interupt routine. I have looked all over and that handler is only defined in stm32f10x_it.c and stm32f10x_it.h. How does this routine get called, and how does the complier know it has to end with a return from interupt?

smart
Associate II
Posted on May 17, 2011 at 12:22

Take a look at stm32f10x_vector.c file and this file is compiler dependent.

Inside this file you can find out the interrupt vector table for a Cortex M3 where all interrupts functions are defined.

I hope this will help you to understand.

joseph239955
Associate II
Posted on May 17, 2011 at 12:22

With Cortex-M3, interrupt service routines does not need special ''return from interrupt'' instruction. Exception/Interrupt return is triggered if the return instruction put a special value (called EXC_RETURN) to the program counter. This special value is written to LR(R14) by hardware automatically as the processor enter the exception/interrupt handler. As a result, interrupt/exception handlers can be written as normal C functions.

smart
Associate II
Posted on May 17, 2011 at 12:22

Hello Joseph

Thanks for your reply. That makes perfect sense.

Where we can find out some more details about EXC_RETURN or return from

Exc/int in cortex M3.

:)

joseph239955
Associate II
Posted on May 17, 2011 at 12:22

You can find descriptions of EXC_RETURN in ARM documentation

Cortex-M3 Technical Reference Manual r1p1 (TRM) section 5.4 and 5.8.

(http://infocenter.arm.com/)

ARM v7M Architecture Application Level Reference Manual

section B1.2.3

(http://www.arm.com/products/CPUs/ARM_Cortex-M3_v7.html)

per3
Associate II
Posted on May 17, 2011 at 12:22

Quote:

On 28-01-2008 at 18:27, Anonymous wrote:

Take a look at stm32f10x_vector.c file and this file is compiler dependent.

Inside this file you can find out the interrupt vector table for a Cortex M3 where all interrupts functions are defined.

I hope this will help you to understand.

Thanks, only on the Ride 7 system this file is renamed to crt0_STM32x.c, however in the header comments of this file the file says its name is stm32f10x_vector.c.