-
Notifications
You must be signed in to change notification settings - Fork 624
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
Add support for esp_hosted #625
Comments
Hi @AndyDevLat Thanks for reporting. The esp32 port so far has only targeted the version with internal virtual HCI interface and most porting has ended up in btstack_port_esp32.c. For use on the ESP32-P4, the hci_transport_t interface that currently uses VHCI should be replaced, e.g. separate file or put in some #ifdef guard, and a new implementation that uses the new 'esp_hosted' component. What did you need to change in esp-hosted? BTstack's transport interface is intended to be as flexible as possible. Btw. looks like the ESP32-P4-Function-EV-Board would be useful to test this. Where did you get yours? Google suggests that the best options is AliExpress currently. |
Thank you for reply! Yes, i got ESP32-P4-Function-EV-Board on Aliexpress from official Espressif store. It will be enough for you to make some testing as it has also ESP32-C6 connected to ESP32-P4 via SDIO interface. But it supports BLE only.
Only some minor stuff. |
Thanks for the additional details. I've ordered the P4 and hope that I can have a look into this when it arrives in two weeks or so (busy in other areas at the moment. And yes, using a ESP32 for Dual-Mode Bluetooth looks like a good idea (you could use any other Bluetooth Controller with UART as well, but the ESP32 is cost-effective and you don't need additional UART pins) |
Yes, and i like that idea more than UART because it provides minimal latency for packet processing between controller and main BtStack thread: SDIO/SPI is magnitudes faster. The fact we don't need UART pins is just a bonus.;) |
Btw, there is one thing i have changed in btstack_config.h too. So you should be careful and I decided to be on the safe side and reduced it. So if you need 1695 bytes indeed then maybe need kindly ask them to increase these values. Also i have set |
It would be good to add support for esp_hosted component in ESP-IDF used by new ESP32-P4 SoC from Espessif. This chip has no onboard radios, but esp_hosted is designed to forward HCI requests to other chip via SPI/SDIO transport.
https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host
Current ESP32 port of BtStack uses VHCI requests, so it cannot work as is.
But I tried to modify btstack_port_esp32.c and replace VHCI calls with calls to esp_hosted component.
Also esp_hosted component had to be slightly changed, so i could forward packets received from SPI/SDIO transport to BtStack main thread, as if they came from VHCI.
I have reported this issue here and they also asked to notify BtStack developers about this:
espressif/esp-hosted-mcu#7
My current solution seems to work, but it needs more testing. Maybe there is some more elegant solution though.
The text was updated successfully, but these errors were encountered: