Senior
November 5, 2024
Solved
cannot use NVIC_SetVector
- November 5, 2024
- 5 replies
- 4762 views
I am trying to write interrupts bare-metal style. When I try to set the interrupt vector for LPTIM1 (using B-L071Z-LRWAN1) using this method,
NVIC_SetVector(LPTIM1_IRQn, (uint32_t)&LPTIM1_IRQHandler);
the compiler gives me this error:
../Core/Src/main.c:87:48: error: 'LPTIM1_IRQHandler' undeclared (first use in this function); did you mean 'TIM6_IRQHandler'?
87 | NVIC_SetVector(LPTIM1_IRQn, (uint32_t)&LPTIM1_IRQHandler);
Which I find bizarre, since I am not using timer 6, and LPTIM1_IQRHandler is listed in startup_stm32l072czyx.s. I tried declaring LPTIM1_IRQHandler as an extern, but with no success. Attached is the startup file.
How do I fix this?
