New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach pin interrupt with framework esp-idf resulting in LoadProhibited panic #2483
Comments
Comparing the gpio code in ESPHome for esp-idf with the documentation for esp-idf, I don't see any obvious things that are wrong (unfortunately). I'll start on working backwards from the point where the panic occurs, to find out what NULL pointer we're looking at here. |
Not a fun thing to debug, but I got a step further:
|
One more step. The call to
|
The call returns error code 261 (0x105), which is The only reference to that value in esp_err_t gpio_isr_register(void (*fn)(void *), void *arg, int intr_alloc_flags, gpio_isr_handle_t *handle)
{
// -----8<------ cut non-interesting code
#if CONFIG_FREERTOS_UNICORE
gpio_isr_register_on_core_static(&p);
ret = ESP_OK;
#else /* CONFIG_FREERTOS_UNICORE */
ret = esp_ipc_call_blocking(gpio_context.isr_core_id, gpio_isr_register_on_core_static, (void *)&p);
#endif /* !CONFIG_FREERTOS_UNICORE */
if(ret != ESP_OK || p.ret != ESP_OK) {
return ESP_ERR_NOT_FOUND;
}
return ESP_OK;
} I verified that the |
What fails for The issue is that the
This flag matches as a direct result of using the flag I changed the esphome code to adhere to this constraint and TADA! 🎉 Great, that was a fun challenge. |
The problem
When using a component that attaches an interrupt to a GPIO pin, a panic reboot is triggered.
I noticed when porting my own component code to the 2021.10.0-dev branch, but I can reproduce the behavior with other components as well, for example
rotary_encoder
.Which version of ESPHome has the issue?
2021.10.0-dev
What type of installation are you using?
pip
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP32
Board
ESP32-WROOM-32D
Component causing the issue
rotary_encoder
Example YAML snippet
Anything in the logs that might be useful for us?
The text was updated successfully, but these errors were encountered: