From 0ebe2cecfa4bc386b2db79e612bc2dd8e36acf81 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 12 Jul 2023 11:28:45 +0200 Subject: [PATCH] feat(system): add an error log and a hint on failed interrupt alloc When interrupt allocation fails, esp_intr_alloc will now print a message telling that no free interrupt was found. This message is then checked in hints.yml, to give a link to the troubleshooting guide. --- components/esp_hw_support/intr_alloc.c | 1 + tools/idf_py_actions/hints.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/components/esp_hw_support/intr_alloc.c b/components/esp_hw_support/intr_alloc.c index 3e01108d1b..df279e14fb 100644 --- a/components/esp_hw_support/intr_alloc.c +++ b/components/esp_hw_support/intr_alloc.c @@ -542,6 +542,7 @@ esp_err_t esp_intr_alloc_intrstatus(int source, int flags, uint32_t intrstatusre //None found. Bail out. portEXIT_CRITICAL(&spinlock); free(ret); + ESP_LOGE(TAG, "No free interrupt inputs for %s interrupt (flags 0x%X)", esp_isr_names[source], flags); return ESP_ERR_NOT_FOUND; } //Get an int vector desc for int. diff --git a/tools/idf_py_actions/hints.yml b/tools/idf_py_actions/hints.yml index 91617035ca..1a9c722f88 100644 --- a/tools/idf_py_actions/hints.yml +++ b/tools/idf_py_actions/hints.yml @@ -384,3 +384,7 @@ - re_variables: ['ESP_HF_CME_MEMEORY_FAILURE'] hint_variables: ['ESP_HF_CME_MEMEORY_FAILURE', 'ESP_HF_CME_MEMORY_FAILURE '] + +- + re: "intr_alloc: No free interrupt inputs for [_\\w]+ interrupt" + hint: "For troubleshooting instructions related to interrupt allocation, run 'idf.py docs -sp api-reference/system/intr_alloc.html'"