Page 1 of 1

Registering high-level interrupt with esp_intr_alloc

Posted: Fri Mar 01, 2019 3:16 pm
by underflow
Hello,

I'm successfully using high-level/high-priority interrupt 5 written in assembly as a follow-up to viewtopic.php?f=12&t=8886

According to High-Level Interrupts (https://docs.espressif.com/projects/esp ... html#notes) and the documentation of esp_intr_alloc (https://docs.espressif.com/projects/esp ... r_handle_t) the latter function is the designated way of registering this interrupt handler.

Registering the interrupt via lower-level functions gives the expected behaviour:

Code: Select all

intr_matrix_set(xPortGetCoreID(), ETS_UART1_INTR_SOURCE, 26);
ESP_INTR_ENABLE(26);
But registering via esp_intr_alloc like

Code: Select all

esp_intr_alloc(ETS_UART1_INTR_SOURCE, ESP_INTR_FLAG_LEVEL5 | ESP_INTR_FLAG_IRAM, NULL, NULL, NULL);
fails because this interrupt is marked as reserved int the table used by esp_intr_alloc (https://github.com/espressif/esp-idf/bl ... loc.c#L121). The debug output gives:

Code: Select all

D (8022) intr_alloc: Int 26 reserved 1 level 5 LEVEL hasIsr 0
D (8022) intr_alloc: ....Unusable: reserved
[...]
D (8022) intr_alloc: get_available_int: using int -1
But according to the high-level interrupt documentation this one should be available and registerable via esp_intr_alloc. Any ideas what I am missing here?


Best regards,

Christian

Re: Registering high-level interrupt with esp_intr_alloc

Posted: Fri Mar 01, 2019 3:29 pm
by ESP_igrr
This should be fixed by this PR: https://github.com/espressif/esp-idf/pull/3040 — will be merged soon.

Re: Registering high-level interrupt with esp_intr_alloc

Posted: Fri Mar 01, 2019 3:34 pm
by underflow
Thank you very much! Then I just have to wait for this pull-request to get merged. :)