Can't return from RTC_IRQHandler

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
towec_2281206
Level 1
Level 1
First question asked

Hello everybody,

my Real Time Clock (RTC) on the S6E2DH5J0A works well.

Now I want to set up a 1-second-interrupt.

After clearing all interrupt flags, enabeling the 1-second-interrupt and enabeling (and clearing) the NIVC, the RTC_IRQHandler (void) will be executed immediately.

Moreover it is not possible to return from the RTC_IRQHandler, although I have cleared every interrupt flag and the NIVC.

Did someone have the same problem? Can someone post some code example for setting up the 1 second interrupt of the RTC?

PS: I use FreeRTOS on my MCU.

0 Likes
1 Reply
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Sample code for Peripheral control including RTC is included in the Peripheral Driver Library (PDL).

For S6E2DH5J0A (FM4) please install PDL version 2.1.x and refer to the following file.

(Install Directory)\2.1.0\drivers\rtc\rtc.[c|h]

Following functions of rtc.c will be helpful.

void Rtc_IrqHandler (volatile stc_rtcn_t * pstcRtc, stc_rtc_intern_data_t * pstcRtcInternData)

en_result_t Rtc_ClrIrqFlag (volatile stc_rtcn_t * pstcRtc, en_rtc_irq_sel_t enIrqSel)

0 Likes