Skip to content

Commit 8db3b40

Browse files
STM: change rtc irq handler name
Fix for the error caused by lto on armc6 compiler: L6137E: Symbol RTC_IRQHandler was not preserved by the LTO codegen but is needed by the image. lto optimization cause that local symbol RTC_IRQHandler(from rtc_api.c) somehow interferes with global symbol RTC_IRQHandler (from startup_stm32f070xb.S) Changing local RTC_IRQHandler to _RTC_IRQHandler fixes problem
1 parent 28b1169 commit 8db3b40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

targets/TARGET_STM/rtc_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ int rtc_isenabled(void)
289289

290290
#if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM
291291

292-
static void RTC_IRQHandler(void);
292+
static void _RTC_IRQHandler(void);
293293
static void (*irq_handler)(void);
294294

295295
volatile uint8_t lp_Fired = 0;
296296

297-
static void RTC_IRQHandler(void)
297+
static void _RTC_IRQHandler(void)
298298
{
299299
/* Update HAL state */
300300
RtcHandle.Instance = RTC;
@@ -428,7 +428,7 @@ void rtc_set_wake_up_timer(timestamp_t timestamp)
428428
}
429429
#endif /* RTC_WUTR_WUTOCLR */
430430

431-
NVIC_SetVector(RTC_WKUP_IRQn, (uint32_t)RTC_IRQHandler);
431+
NVIC_SetVector(RTC_WKUP_IRQn, (uint32_t)_RTC_IRQHandler);
432432
irq_handler = (void (*)(void))lp_ticker_irq_handler;
433433
NVIC_EnableIRQ(RTC_WKUP_IRQn);
434434
core_util_critical_section_exit();
@@ -437,7 +437,7 @@ void rtc_set_wake_up_timer(timestamp_t timestamp)
437437
void rtc_fire_interrupt(void)
438438
{
439439
lp_Fired = 1;
440-
NVIC_SetVector(RTC_WKUP_IRQn, (uint32_t)RTC_IRQHandler);
440+
NVIC_SetVector(RTC_WKUP_IRQn, (uint32_t)_RTC_IRQHandler);
441441
irq_handler = (void (*)(void))lp_ticker_irq_handler;
442442
NVIC_SetPendingIRQ(RTC_WKUP_IRQn);
443443
NVIC_EnableIRQ(RTC_WKUP_IRQn);

0 commit comments

Comments
 (0)