Registering high-level interrupt with esp_intr_alloc

underflow
Posts: 3
Joined: Thu Jan 17, 2019 10:18 pm

Registering high-level interrupt with esp_intr_alloc

Postby underflow » Fri Mar 01, 2019 3:16 pm

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

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Registering high-level interrupt with esp_intr_alloc

Postby ESP_igrr » Fri Mar 01, 2019 3:29 pm

This should be fixed by this PR: https://github.com/espressif/esp-idf/pull/3040 — will be merged soon.

underflow
Posts: 3
Joined: Thu Jan 17, 2019 10:18 pm

Re: Registering high-level interrupt with esp_intr_alloc

Postby underflow » Fri Mar 01, 2019 3:34 pm

Thank you very much! Then I just have to wait for this pull-request to get merged. :)

Who is online

Users browsing this forum: Google [Bot] and 72 guests