Regarding RTC inbuilt wakeup interrupt

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Mohan
Posts: 4
Joined: Fri Dec 29, 2023 12:35 pm

Regarding RTC inbuilt wakeup interrupt

Postby Mohan » Fri Dec 29, 2023 12:45 pm

Hi, I'm working on STM32F407 with RTC Wakeup interrupt in low power mode,
whenever I'm using the In-built RTC functions and try to use IRQ handler error is coming as "Multiple definitions of Vector 4C " tried commenting everywhere including os and hal files but not yet working, when tried with register level code the LSE is not getting ON and so interrupt not coming.

please help me resolve this as I am beginner who now only started.

I will share my RTC config with this post, request someone to help with this.
Thanks,

void rtc_init_func(void){
RCC->APB1ENR |= (1U << 28); // Enable Power interface clock
RCC->APB1LPENR |= (1U << 28); // Enable Power interface clock low power mode
// RCC->CFGR |= (1<<21); // Enabling LSE Oscillator in MCO1

PWR->CR |= (1U << 8);

RTC->WPR = 0xCA; // Unlock write protection
RTC->WPR = 0x53;
normal_clock_config();
if(!(RCC->BDCR & (1 << 15))){
RCC->BDCR |= (1<<16) ; // Reset the backup domain
RCC->BDCR = 0x00008101; // Set RTCEN, select LSE, set LSEON
while((RCC->BDCR & (1UL << 1)) == 0); // Wait for LSERDY

}

EXTI->IMR |= (1 << 22); // Set EXTI22 for wake-up timer
EXTI->RTSR |= (1 << 22); // Enable rising edge trigger
EXTI->FTSR &= ~(1 << 22); // Enable rising edge trigger

RTC->CR |= (1<<14); // Enable wake-up timer interrupt

// RTC->PRER = 0x7FFF; // Set the prescaler for 1Hz RTC clock
RTC->ISR |= (1U << 7); // Enter initialization mode, bit 7
while(RTC->ISR & (0 << 6));

RTC->CR &= ~(1U << 10); // Stop wake-up timer, to access it

while(RTC->ISR & (0 << 6)); // Wait for wake-up timer access

RTC->CR |= (3U << 0); // selecting CLK/2.

RTC->PRER = 0x007F00FF; // Set the prescaler for 1Hz RTC clock
RTC->WUTR = 0;
RTC->WUTR = 1; // Set timer period

RTC->CR |= (1U << 10); // Enable wake-up timer


RTC->ISR &= ~(1U << 7); // Exit initialization mode



RTC->WPR = 0xFF; // Lock write protect
PWR->CR &= ~(1U << 8); // Inhibit RTC access

NVIC_EnableIRQ(3);
NVIC_SetPriority(3, 15);
// nvicEnableVector(RTC_WKUP_IRQn, STM32_IRQ_EXTI22_PRIORITY);
chThdSleepMilliseconds(100);

}

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Regarding RTC inbuilt wakeup interrupt

Postby Giovanni » Fri Dec 29, 2023 9:50 pm

Hi,

The RTC driver defines that vector, if you want to define it yourself then you should disable the RTC driver.

Giovanni

Mohan
Posts: 4
Joined: Fri Dec 29, 2023 12:35 pm

Re: Regarding RTC inbuilt wakeup interrupt

Postby Mohan » Tue Jan 02, 2024 7:16 am

Thanks for the Reply,

I tried with Disabling the RTC driver and wrote the abovementioned register level function but the STM32F407 is not waking up can you please share the RTC wakeup config for 1 sec delay or check if the above register config has any problems.

Thank you.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Regarding RTC inbuilt wakeup interrupt

Postby Giovanni » Tue Jan 02, 2024 9:11 am

Hi,

There is a contributed wakeup example in the STM32F4xx-RTC demo.

Giovanni

Mohan
Posts: 4
Joined: Fri Dec 29, 2023 12:35 pm

Re: Regarding RTC inbuilt wakeup interrupt

Postby Mohan » Tue Jan 02, 2024 9:32 am

Thanks for the Reply,

How & where to check the Example code.
Please help as I am new to Chibios.
Thank you

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Regarding RTC inbuilt wakeup interrupt

Postby Giovanni » Tue Jan 02, 2024 1:14 pm

Hi,

How new? are you already able to compile and run demo applications?

If not then install ChibiStudio and follow the guides on http://www.playembedded.org for a quick startup with ChibiOS.

Giovanni

Mohan
Posts: 4
Joined: Fri Dec 29, 2023 12:35 pm

Re: Regarding RTC inbuilt wakeup interrupt

Postby Mohan » Wed Jan 03, 2024 5:16 am

Thank you,
I am able to Build Demo programs and have been doing basic programs, and started RTC .


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 2 guests