The tutorial on ESP32 with Arduino has solved many problems for me. But one remains…
How do I designate a particular core to service a hardware interrupt from a specified pin? I have two interrupts that I want serviced by different cores…
At the moment, I don’t have any example about that subject and I’ve actually never tried it myself. This documentation covers everything about interrupts on the ESP32 and their allocation: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/intr_alloc.html
I hope it helps! Regards,
Thanks! yes, here it is…
Non-internal interrupt slots in both CPU cores are wired to an interrupt multiplexer, which can be used to route any external interrupt source to any of these interrupt slots.
- Allocating an external interrupt will always allocate it on the core that does the allocation.
- Freeing an external interrupt must always happen on the same core it was allocated on.
- Disabling and enabling external interrupts from another core is allowed.
- Multiple external interrupt sources can share an interrupt slot by passing
ESP_INTR_FLAG_SHAREDas a flag to esp_intr_alloc().
Care should be taken when calling esp_intr_alloc() from a task which is not pinned to a core. During task switching, these tasks can migrate between cores. Therefore it is impossible to tell which CPU the interrupt is allocated on, which makes it difficult to free the interrupt handle and may also cause debugging difficulties. It is advised to use xTaskCreatePinnedToCore() with a specific CoreID argument to create tasks that will allocate interrupts. In the case of internal interrupt sources, this is required.
Thank you. I have profited enormously from your knowledge of this processor…