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);
}
Regarding RTC inbuilt wakeup interrupt
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Regarding RTC inbuilt wakeup interrupt
Hi,
The RTC driver defines that vector, if you want to define it yourself then you should disable the RTC driver.
Giovanni
The RTC driver defines that vector, if you want to define it yourself then you should disable the RTC driver.
Giovanni
Re: Regarding RTC inbuilt wakeup interrupt
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.
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.
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Regarding RTC inbuilt wakeup interrupt
Hi,
There is a contributed wakeup example in the STM32F4xx-RTC demo.
Giovanni
There is a contributed wakeup example in the STM32F4xx-RTC demo.
Giovanni
Re: Regarding RTC inbuilt wakeup interrupt
Thanks for the Reply,
How & where to check the Example code.
Please help as I am new to Chibios.
Thank you
How & where to check the Example code.
Please help as I am new to Chibios.
Thank you
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Regarding RTC inbuilt wakeup interrupt
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
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
Re: Regarding RTC inbuilt wakeup interrupt
Thank you,
I am able to Build Demo programs and have been doing basic programs, and started RTC .
I am able to Build Demo programs and have been doing basic programs, and started RTC .
Who is online
Users browsing this forum: Bing [Bot] and 3 guests