IRAM_ATTR timer ISR

boborjan
Posts: 9
Joined: Thu Sep 19, 2019 5:46 pm

IRAM_ATTR timer ISR

Postby boborjan » Sat Mar 27, 2021 7:52 pm

It is well described in the docs that interrupt service routines that need to be enable during flash activity (write/erase only?) have to be put in ram and marked by IRAM_ATTR. These ISRs cannot call functions that are not placed in RAM - or exception will follow (discussed e.g. here: https://www.esp32.com/viewtopic.php?t=7684) .

In a timer group ISR, docs state it is necessary to call timer_spinlock_take() before calling timer API function like timer_group_clr_intr_status_in_isr(). However, while the latter is marked as IRAM_ATTR, timer_spinlock_take() is not. Is it a bug?
Shall I call timer_spinlock_take() from my IRAM ISR?
(I can confirm by the generated .map file that timer_spinlock_take() is not in the iram region)

+1: I need to notify a task from my timer ISR. Normally this is done via xTaskNotifyFromISR(). In another topics I read FreeRTOS API is loaded completely to IRAM - is that still so? Can one rely on that? (.map file shows that xTaskNotifyFromISR() is indeed in iram)

Thanks
Viktor

Who is online

Users browsing this forum: Bing [Bot], dg9ngf and 98 guests