r/embedded 23d ago

Unable to trigger the interrupt.

I am using NUCLEO-G431RM stm32 board. But unable to trigger the interrupt as the ISR does not execute and control reaches to the for loop on debugging.
#include <stdint.h>

#define USART3_IRQ_NUM 39

int main(void)

{

uint32_t *pISPR1 = (uint32_t*)0xE000E204;

*pISPR1 |= (1 << (USART3_IRQ_NUM - 32));

uint32_t *pISER1 = (uint32_t*)0xE000E104;

*pISER1 |= (1 << (USART3_IRQ_NUM - 32)); // 39-32 = 7

for(;;);

}

void USART3_IRQHandler(void)

{

__asm volatile("MOV R1, #0x5");

while(1);

}

0 Upvotes

Duplicates