cancel
Showing results for 
Search instead for 
Did you mean: 

Software interrupt basics

Beck.Karl-Michael
Associate III
Posted on August 25, 2016 at 17:02

Hello,

i try to intialize and rise an software interrupt on stm32 platform.

As far as i've found out one needs to set ExtI.SWIER register which effectively will invoke the interrupt handler function.

So i assume setting ExtI.SWIER |= 4

will call the EXTI2_IRQHandler.

Q1: is that right?

Q2: How does the mapping between the SWIER bit number to the IRQ_Handler work? I mean, there are 23 ier-sw interrupts or so but only 5 ExtIX handlers...

2. there seem some initialization to be missing. I found a statement here in the forum that IER has to be set.... Now IER exists in various registers like lcd, flash .... but none of them seems to match this approach.

Q3: Which IER register has to be set?

In the docu it's stated that ExtI.IMR and ExtI.EMR needs to be setup too. As far as i understand i don't need Ext.Emr (thats only for rising/falling edge events)

Q4: Is that right?

Thanks+ cheers.

#software-interrupt #rtfm
2 REPLIES 2
Posted on August 25, 2016 at 18:22

A2

                DCD     EXTI15_10_IRQHandler              ; External Line[15:10]s                                  

                DCD     RTC_Alarm_IRQHandler              ; RTC Alarm (A and B) through EXTI Line                  

                DCD     OTG_FS_WKUP_IRQHandler            ; USB OTG FS Wakeup through EXTI line                        

                DCD     PVD_IRQHandler                    ; PVD through EXTI Line detection                        

                DCD     TAMP_STAMP_IRQHandler             ; Tamper and TimeStamps through the EXTI line            

                DCD     RTC_WKUP_IRQHandler               ; RTC Wakeup through the EXTI line                       

EXTI10, EXTI11, EXTI12, EXTI13, EXTI14, EXTI15 go to EXTI15_10_IRQHandler

EXTI17 to RTC_Alarm_IRQHandler

EXTI22 to RTC_WKUP_IRQHandler

Thought about using SVC ??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Beck.Karl-Michael
Associate III
Posted on August 26, 2016 at 13:55

Thanks. And 

A3: NVIC.ISER[0] |= 0x100;  // For EXTI2_IRQHandler

Thougth about using svc. As far as i understand it's a sw interrupt which supports some function parameters. I don't need this so ''normal'' sw interrupt is enought for me.