cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F745 RTC Alarm interrupt.

BPetk.1
Associate II

I have a very peculiar problem with my STM32F745 MCU. I have generated code with CubeMX which is very basic and doesn't initialize any peripherals at all.

Main simply initializes the HAL, clock & then goes into an infinite loop that increments a counter variable.

However, after a short time the loop stops and the application seems stuck. Debugging shows that the time it takes the application to stop working is constant - the value of the counter is always the same - and when inspecting the PC register after the app gets stuck it always points to RTC_Alarm_IRQHandler.

Suspecting spurious interrupts, I have attempted to disable RTC alarms and the interrupt itself but nothing seems to be working. It always ends up getting stuck with PC showing towards the same IRQ handler.

I've tried disabling the interrupt using both:

HAL_NVIC_DisableIRQ(RTC_Alarm_IRQn);

__HAL_RTC_ALARM_EXTI_DISABLE_IT();

And have also deactivated alarms. When debugging I can confirm that the disable functions are executed and registers are set to correct values.

Has someone experienced anything similar?

2 REPLIES 2
turboscrew
Senior III

And you have the right MCU selected in CubeMX?

Yes, I have. I'm using STM32F745VET6 LQFP100 and have selected STM32F745VETx LQFP100 in the CubeMX project.