shvass opened a new issue, #18497: URL: https://github.com/apache/nuttx/issues/18497
### Description Hello, I would like to propose an implementation approach to add ESP-Hosted support for NuttX. I've researched the implementation required to support ESP-Hosted on NuttX. I studied the architecture of ESP-Hosted-NG (the Linux kernel module) and the NuttX network stack along with its lower-half network driver interfaces. ### Implementation [ ESP-Hosted-NG](https://github.com/espressif/esp-hosted/) exposes an API compatible with Linux 802.11 drivers. Its internal architecture roughly follows the structure below (this is largely undocumented, so I derived it from the source code). ``` +------------------------------------------------------------------------------+ | ESP-Hosted-NG Linux Kernel Module Architecture | |------------------------------------------------------------------------------| | Linux Networking Interface | | cfg80211/mac80211 subsystem hooks and registered driver | |------------------------------------------------------------------------------| | ESP hosted Core Driver API (esp_api / esp_cmd) | | Provides the primary API used by the driver to communicate with the | | ESP32-series co-processor (esp_api.h & esp_cmd.h) | |------------------------------------------------------------------------------| | . . . | |------------------------------------------------------------------------------| | Transport Abstraction (esp_if_ops) | | struct esp_if_ops provides function pointers for transport operations such | | as read(), write(), init(), etc. | |------------------------------------------------------------------------------| | Physical Transport Driver implementation (OS specific) (SPI/SDIO) | | Populates esp_if_ops with implementation for read, write, init, etc. as per | | communcation medium | |------------------------------------------------------------------------------| ``` - ESP-Hosted provides the `esp_api` interface used by the host driver to interact with the ESP co-processor.. ([`esp_api`](https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/host/include/esp_api.h) [`esp_cmd`](https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/host/include/esp_cmd.h) - This API includes functions for device initialization, configuration, and wireless interface management. - There is a transport abstraction [`esp_if_ops`](https://github.com/espressif/esp-hosted/blob/1a5fb9900efbc377d8bb3ffe3b4d999428af3a73/esp_hosted_ng/host/include/esp_if.h#L13) which stores function pointers for a communication interface. Transport implementations (e.g., SDIO or SPI) populate this structure to provide read(), write(), init(), and related operations. #### esp_hosted nuttx module functionality - The module registers as a lower-half network driver with the NuttX network stack and populates the `netdev_ops_s` (and wireless control operations where applicable) structs with implementations that forward calls to the corresponding `esp_api` functions. - Implementation of an `esp_nuttx_spi` transport interface that operates on a NuttX `spi_dev_s` device and populates `esp_if_ops`, registering itself as a communication interface. - During initialization, the driver acquires the SPI device, initializes the [`esp_adapter`](https://github.com/espressif/esp-hosted/blob/1a5fb9900efbc377d8bb3ffe3b4d999428af3a73/esp_hosted_ng/host/include/esp.h#L88), and performs device initialization. ### current Progress - I've setup esp-hosted on raspi 3B+ connected to ESP32C3 running esp-hosted firmware and acting as a co-processor for the host. The additional wlan interface functions normally (running it in AP mode) . - I have also got stm32F107 running nuttX where I plan to carry further development. ### upcoming planned tasks I intend to demonstrate a module interfacing with an ESP32xx device over SPI via `esp_api`. The initial goal is a basic example that initializes the device and fetches firmware info. For this I would need to:- - Port esp_api from linux to nuttx. (`esp_api` currently relies on Linux data structures and kernel primitives for threading and synchronisation.) - Develop an `esp_nuttx_spi` transport implementation that operates on a NuttX SPI device and binds it to the `esp_api` transport abstraction (`esp_if_ops`). - make API calls to initialise the device and interface and get device info via `esp_get_hardware_name()`. **About Me** - I'm a final-year B.Tech student in Electronics and Telecommunication Engineering at VIIT, Pune. - I've previously contributed to linux kernel ([IIO subsystem](https://lore.kernel.org/linux-iio/[email protected]/)) and [micro-ROS](https://github.com/micro-ROS/micro_ros_espidf_component/pull/250) - I've experience working with various RTOSes such as FreeRTOS, zephyr and specifically with ESP32xx MCUs. **References** - [Apache Software Foundation — GSoC 2026 Ideas List: Add support to ESP Hosted on NuttX](https://cwiki.apache.org/confluence/display/COMDEV/GSoC+2026+Ideas+list#GSoC2026Ideaslist-AddsupporttoESPHostedonNuttX) - [ ESP-Hosted-NG](https://github.com/espressif/esp-hosted/) ### Verification - [x] I have verified before submitting the report. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
