Question
Trouble with RTC and 1Hz interrupt
Posted on September 18, 2016 at 09:40
Hello,
I have been hanging on this problem since days and have googeld a very lot but can not solve this.I am working with a Nucleo F411RE and TrueStudio. I want to generate a 1Hz interrupt with the RTC. The system is running and the RTC is nicely running too. I can see the Seconds count and it is very accurate holding the time. So I assume that all is configured correctly regarding the RTC itself. But I can not get the interrupt to work. The WUTIE is set and the WUT is enabled. I checked that all by looking at the register.I have tryed the Tamp-Stamp-IRQ and the Wakeup-IRQ. But either nothing happens or the interrupt ends up in the ''Infinite_Loop''. My code regarding the interrupt setup: rtc_unlock(); B_OUT(RTC->CR, bit14|bit10|bit2); rtc_lock(); B_SET(EXTI->IMR, bit22); B_SET(EXTI->RTSR, bit22); B_SET(EXTI->SWIER, bit22); NVIC_SetPriorityGrouping(0); NVIC_SetPriority(RTC_WKUP_IRQn, 10); NVIC_EnableIRQ(RTC_WKUP_IRQn);In the startup_stm32f411xe.s I looked up the funktionname from the RTC_WKUP_IRQHandler and set my IRQhandler to that name. Is there any advice on this, I am getting desperately on this one. How can I get the interrupt to jump into my function? void RTC_WKUP_IRQHandler(){ B_SET(EXTI->PR, bit22); NUCLEO_LED_ON;}Do I have to specify my function somehow to tell the compiler to use it?Am greatfull for any tips.Thanks, regards