Hi, I'm looking at this code: http://www.lucadentella.it/en/2017/02/2 ... interrupts
What this code does: 1 interrupt source --> 1 ISR handler --> 1 semaphore --> 1 loop processing events delivered via xSemaphoreTake().
But I need to handle a multiple interrupts sources.
If I pass individual ID's as arg to gpio_isr_handler_add(), I can handle multiple interrupt sources and I still only need 1 ISR handler. This is great! But how am I supposed to forward the individual ID's through the semaphore mechanism? Do I need to use a list of semaphores, 1 per event source? Oh no. And then I also need to code and run a dedicated loop for each semaphore?? That can't be right. Hopefully someone can point me in a better direction. Thank you.
Processing multiple interrupts sources
Re: Processing multiple interrupts sources
Task notification, event group, queue, ... Depends on how much info you need to send to the task
http://www.freertos.org/RTOS_Task_Notif ... Group.html
http://www.freertos.org/RTOS_Task_Notif ... Group.html
Re: Processing multiple interrupts sources
Thank you. This makes a lot of sense.
Unfortunately after switching from xSemaphoreGiveFromISR() to xTaskNotifyFromISR() I now get this:
Only if I out-remark the call to xTaskNotifyFromISR() from my ISR, do I get rid of the Guru Meditation. Is there some working xTaskNotifyFromISR() sample code for ESP32 anywhere to look at / try out?
Also: portYIELD_FROM_ISR(xHigherPriorityTaskWoken) does not seem to be supported. However portYIELD_FROM_ISR() appears to be. So I don't need to use xHigherPriorityTaskWoken, right? Thx.
Unfortunately after switching from xSemaphoreGiveFromISR() to xTaskNotifyFromISR() I now get this:
I then rolled back the changes to my task method (went back from xTaskNotifyWait() to xSemaphoreTake()) but Guru Meditation still occurs. So my task method is not being triggered by xTaskNotifyFromISR(). It just sits there doing nothing. It should definitely not be involved.Untested FreeRTOS function xTaskNotifyFromISR
/home/dave/code/esp32/esp-idf/components/freertos/./tasks.c:4780 (xTaskNotifyFromISR)- assert failed!
abort() was called at PC 0x4008503a
Guru Meditation Error: Core 0 panic'ed (abort)
Only if I out-remark the call to xTaskNotifyFromISR() from my ISR, do I get rid of the Guru Meditation. Is there some working xTaskNotifyFromISR() sample code for ESP32 anywhere to look at / try out?
Also: portYIELD_FROM_ISR(xHigherPriorityTaskWoken) does not seem to be supported. However portYIELD_FROM_ISR() appears to be. So I don't need to use xHigherPriorityTaskWoken, right? Thx.
Re: Processing multiple interrupts sources
Oops didn't realize this was on the untested blacklist. You can disable the abort in menuconfig if you want to try it.
Re: Processing multiple interrupts sources
It doesn't say "Untested FreeRTOS... abort() was called" any more. But it still says "Guru Meditation" as soon as xTaskNotifyFromISR() has been called. Only now with a slightly different remark:
What else can I try? I only need to send 8 (or 16) bits from ISR to task.
"wdt" = Watch Dog Timer, correct? I've tried several values, including portMAX_DELAY. No change.Error: Core 0 panic'ed (Interrupt wdt timeout on CPU1)
What else can I try? I only need to send 8 (or 16) bits from ISR to task.
Re: Processing multiple interrupts sources
Did you try event group?
http://www.freertos.org/event-groups-API.html
http://www.freertos.org/event-groups-API.html
Re: Processing multiple interrupts sources
Event Groups are working well. Thank you so much.
Who is online
Users browsing this forum: ccrause and 235 guests