Skip to main content
Roman REITER
Associate III
January 19, 2022
Solved

Software interrupt with STM32

  • January 19, 2022
  • 1 reply
  • 5642 views

Hi there,

I'm trying to implement a software interrupt using the STM32L432KC. I want to trigger an interrupt when I reach a certain point in the code. Unfortunately I didn't find any helpful example.

Once I tried to set bit37 in the IMR2 register.

SET_BIT(EXTI->IMR2 , EXTI_IMR2_IM37_Msk);

and am assumed that when setting the same bit by name in the SWIER register triggers the interrupt.

SET_BIT(EXTI->SWIER2 , EXTI_SWIER2_SWI37_Msk);

But it doesn't work. The program does not jump into the function

void SVC_Handler (void)

Can someone explain to me how to do this!?

This topic has been closed for replies.
Best answer by Javier1

Software Trigger Interrupt Register (STIR)

https://stackoverflow.com/questions/44482964/using-exti-line-for-software-interrupt

1 reply

Javier1
Javier1Best answer
Principal
January 19, 2022
hit me up in https://www.linkedin.com/in/javiermuñoz/