2008-01-30 08:00 AM
interupts
2011-05-17 03:22 AM
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?2011-05-17 03:22 AM
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.2011-05-17 03:22 AM
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.
2011-05-17 03:22 AM
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. :)2011-05-17 03:22 AM
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)2011-05-17 03:22 AM
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.