Feature: add option for restarting radio using callback function instead of GPIO (EHM-196) - #175
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable “reset slave via user callback” mechanism so boards without a directly connected reset GPIO (e.g., reset driven via an external I2C device) can still reset the radio/slave device.
Changes:
- Adds Kconfig options (per transport) to select callback-based slave reset and a derived common config flag.
- Introduces a new OS abstraction hook (
_h_restart_slave) with an ESP FreeRTOS implementation that either toggles the reset GPIO or invokeshosted_reset_slave_callback(). - Updates transport drivers (SPI/SDIO/SPI HD/UART) and power-save reset-gpio hold/release logic to use the new restart/reset path.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
Kconfig |
Adds menuconfig options to enable callback-based slave reset per transport and a derived common flag. |
host/port/esp/freertos/src/port_esp_hosted_host_os.c |
Implements hosted_restart_slave() and wires it into the OS abstraction table. |
host/port/esp/freertos/include/port_esp_hosted_host_config.h |
Adjusts reset pin macro handling (but currently only for SDIO callback). |
host/esp_hosted_os_abstraction.h |
Extends the hosted_osi_funcs_t table with _h_restart_slave. |
host/drivers/transport/uart/uart_drv.c |
Switches reset logic to _h_restart_slave() (currently introduces a compile error in logging). |
host/drivers/transport/spi/spi_drv.c |
Switches reset logic to _h_restart_slave() via helper. |
host/drivers/transport/spi_hd/spi_hd_drv.c |
Switches reset logic to _h_restart_slave() directly. |
host/drivers/transport/sdio/sdio_drv.c |
Switches reset logic to _h_restart_slave() via helper. |
host/drivers/power_save/power_save_drv.c |
Skips reset GPIO hold/release when callback-based reset is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
becb28c to
740cce7
Compare
|
Can anyone give a progress update? When can I expect this PR to be reviewed and/or merged? |
|
@mantriyogesh @SohKamYung-Espressif This PR has been waiting for months, I'd love to at least get some form of feedback so we can move this forward. I'd like to get this or similar functionality merged soon so that we can update to new versions of ESP-HOSTED-MCU without having to make any modifications to the core structure. |
Description
This PR adds support for defining a user controlled reset function outside of the ESP-HOSTED scope, to be used instead of reset using GPIO.
I need this feature because on my product the radio reset pin is not directly controlled using a GPIO on the ESP32-P4 but instead via an I2C connected device, the callback function allows me to reset the radio using this alternative method.
Related
This is a re-implementation of the feature introduced earlier in this PR: #101
Testing
Tested by enabling the new menuconfig option and defining a callback function.