Table of Contents
There are several considerations that need to be taken into account when implementing ESP-Hosted for your system.
For prototyping, any ESP32 chip can be used as the slave, provided it has the required interface (SPI, SDIO). But when creating an actual product, it is important to select the proper ESP32 chip as a Hosted Slave.
There are many ESP32 chips, each with difference features and performance capabilities. Based on your product requirements (interface to use, CPU, memory, power requirements, etc.), choose the ESP32 chip(s) that can meet your requirements.
Use the ESP Product Selector guide to help you decide which ESP32 chips and/or modules are suitable for your product.
[!NOTE] See References for links to the Selector Guide and other links.
The project defaults to using an ESP chip as the Hosted Master. This is to act as a reference platform and make it easier to evaluate and test Hosted before porting it to your MCU of choice.
Make sure the correct GPIOs pins on the Hosted Slave and Master are
connected together. Verify that the correct GPIOs are set-up in
Menuconfig for both the Slave and Master.
[!NOTE] In general most ESP GPIOs can be used for input and output. But on the ESP32, some GPIOs can only be used for input and are not usable under Hosted. Check the ESP datasheet to verify the GPIOs you select can be used as a Hosted interface.
It is flexible to evaluate with jumper cables or bread board than full-fledged PCB. In general, SPI (Standard & Dual SPI) imposes fewer hardware requirements compared to SDIO. SPI is easier to prototype, and available on more ESP chips and MCUs compared to SDIO. Before going to SDIO 4 bit mode PCB, it's better to evaluate SDIO 1-Bit mode.
Once you evaluate the solution on jumper cables, you can move to PCB solutions with same or high performance transport.
IO_MUX GPIOs.In general, ESP peripheral interfaces can be assigned to any available
GPIO through a multiplexer. But some ESPs have dedicated GPIOs for
peripherals (IO_MUX). These IO_MUX GPIOs have better timing
characteristics and support higher frequencies. They should be use
when possible to minimise timing and skew issues when using the
interface for Hosted.
[!NOTE] The SDIO interface on the ESP32 and ESP32-C6 have fixed GPIO assignments and cannot be changed.
For best performance, a PCB with traces should be used to connect the
Hosted Slave and Master. For prototyping, jumper cables can be used,
but may only work at a lower CLK frequency.
In general, keep the cable and PCB traces short and of the same length, to minimise propogation delay and clock skew:
Isolate the interface signals, expecially the CLK signal, from other
signals. For PCBs, surround the signal swith a ground plane, and keep
the CLK signal clean by not routing it close to other high frequency
signals.
For jumper cables, you can try surrounding the signals, especially the
CLK signal, with grounded wires to shield them from interference.
[!NOTE] For SDIO, external pull-up resistors (recommended value: 51 kOhms) are required. Using jumper cable are not recommended for SDIO. You may be able to get SDIO working with jumper cables by using a lower
CLKfrequency and using 1-bit SDIO mode.[!NOTE] Also check the Hosted documentation for SPI and SDIO for more information and guidelines on the interfaces.
Adding tapping points or headers to the Hosted interface signals on your prototype will make it easier to check whether the Hosted interface is working as expected.
Add tapping points to some unused GPIOs on both the Hosted Slave and Host on your prototype PCB. This can later be use for debugging or enhancing your own Hosted code.
For example, add your own debugging code to the Hosted Slave and Master code to set a GPIO value when a condition is met. This GPIO can be used to light a LED or trigger a capture on an oscilloscope or logic analyzer, for example. This is useful for capturing rare or intermittent conditions while testing Hosted.
In the future, Hosted may also offer newer transport options or more features, like controlling power modes on the Host and Slave. These may require additional GPIOs for control, so it would be good to keep some additional GPIOs available and accesable for future use.
ESP-Hosted has a Raw Throughput Option to test sending of data between the Host and Slave. This can be used to verify the hardware for signal errors and to check the achievable throughput of Hosted.
[!IMPORTANT] Use this option to verify that Hosted hardware and software are working as expected before involving other software layers like networking.
To enable the Raw Throughput Option on Slave, enter Menuconfig and
enable Example Configuration ---> Hosted Debugging --->
RawTP.
To enable the Raw Throughput Option and set Raw Throughput direction
on Host, enter Menuconfig and enable Component config --->
ESP-Hosted config ---> Debug Settings ---> RawTP. Set
the data transfer direction: Host to Slave, Slave to Host or
Bidirectional.
Check the References below for links to the Product Selector, and more detailed information on the interfaces used in Hosted. If you have other issues with Hosted, you can check the Troubleshooting Guide.
You can also raise an Issue on the ESP-Hosted Github repository. Check that the issue has not already been raised before submitting. The solution to your problem may have already been provided.
External Links
ESP-Hosted Documentation Links