cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 Assembler Interrupt Handling

loder
Associate II
Posted on August 30, 2017 at 11:16

Hello community,

Iwould like to configure Timer 2 of my STM32F103C8 to use it as a simple overflow interrupt service and Iwould like to do this in assembly language.

On page 198 of the reference manual i found this address of the TIM2 global interrupt:0x0000_00B0

But how can I define a section in my code which lies on that address?

For example something like this (pseudo code):

.section 0x000000B0
rjmp myTimer2OverflowHandler�?�?

#stm32 #interrupt
1 REPLY 1
Posted on August 30, 2017 at 17:14

Please review some books and manuals on the Cortex-M3 if you plan of doing assembler.

It is a vector table, not a jump table.

Typically pre-populated with names and weak definitions in startup_stm32f10x.s

So add your code in to a procedure called TIM2_IRQHandler

 .section .text.ITM2_IRQHandler,'ax',%progbits
TIM2_IRQHandler:
/* your code */
 bx lr�?�?�?�?�?�?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..