Skip to main content
loder
Associate II
August 30, 2017
Question

STM32F103 Assembler Interrupt Handling

  • August 30, 2017
  • 1 reply
  • 864 views
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
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
August 30, 2017
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..