Skip to content

Conversation

@renzenicolai
Copy link

@renzenicolai renzenicolai commented Sep 21, 2025

Description

Adds a kconfig option for resetting the SDIO slave using a callback function instead of a GPIO.

This change is needed because on my product the reset line of the ESP32-C6 slave is not directly connected to the ESP32-P4.

This PR adds support for optionally defining a function in user code to replace the reset action normally executed using a GPIO pin, allowing for a custom reset procedure. In our case we send a command to an I2C device in order to reset the ESP32-C6 radio.

Related

Testing

Tested on our hardware using an ESP32-C6 as SDIO slave device.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 21, 2025
@github-actions github-actions bot changed the title Feature: allow SDIO slave reset using callback instead of GPIO Feature: allow SDIO slave reset using callback instead of GPIO (EHM-104) Sep 21, 2025
@renzenicolai
Copy link
Author

renzenicolai commented Nov 12, 2025

I'd love to know when this could be merged or if adding support for such a feature is planned in some other way. Suggestions for changes are welcome of course, just let me know what is needed.

@mantriyogesh
Copy link
Collaborator

I understand why you needed to make this change.

IMO, instead of giving options like this, better we move the slave reseting to port layer.

The port layer implements the function pointer based logic. so if you wish your own way to reset, should be able to hook with that function. the sdio, spi hd, spi fd & uart transports basically should then use the ported function to reset the slave.

I think the port layer here should give you fair idea what I meant.

for example,
_h_msleep interface is defined here and implemented as hosted_msleep()
hosted_msleep definition . Then called in main code base as, g_h.funcs->_h_msleep(10);

I hope you are following till here. in the same way, we can create the g_h.funcs->h_reset_slave() or ``g_h.funcs->h_reset_coprocessor()` can be added in similar lines and used. the port layer is meant to change as per your convenience. but the main code then remains intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Opened Issue is new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants