Supported Targets | ESP32 |
---|
- In this setup, ESP board acts as a SDIO peripheral and provides Wi-Fi capabilities to host. Please connect ESP peripheral to STM32F412ZGT6-Nucleo 144 board's CN8 Extension connecter as mentioned below.
- STM32F412ZGT6-Nucleo 144 should be powered with correct incoming power rating. ESP peripheral and STM32 can be powered through USB-Hub using micro-USB/USB-C cable. It is also used as USART connection for debug logs from host. Serial port communicaton program like tera term or minicom used to print the logs.
- Upcoming releases are expected to have:
- BT/BLE stack integration at MCU side
- ESP32-C6 support for MCU
- ESP chipsets acting as Host MCU (ESP<-->ESP)
- LWIP integration out of the box
STM32 Pin | ESP32 Pin | Function |
---|---|---|
PC8 (pin2) | IO2+pull-up | DATA0 |
PC9 (pin4) | IO4+pull-up | DATA1 |
PC10 (pin6) | IO12+pull-up | DATA2 |
PC11 (pin8) | IO13+pull-up | DATA3 |
PC12 (pin10) | IO14 | Clock |
PD2 (pin12) | IO15+pull-up | Command |
GND (pin13) | GND | Ground |
PG2 (pin14) | EN | Reset ESP |
Setup image is here.
- Use good quality extremely small (smaller than 5cm) jumper wires, all equal length
- Join all possible grounds interconnected to lower noise
- Add at least, 10k Ohm external pull-up resistors on 5 lines: CMD, DAT0-4. We use 51k Ohm resistors in our set-up.
One can load pre-built release binaries on ESP peripheral or compile those from source. Below subsection explains both these methods.
- Download pre-built firmware binaries from releases
- Follow
readme.txt
from release tarball to flash the ESP binary ⚠️ Make sure that you useSource code (zip)
inAssets
fold with associated release for host building.- Windows user can use ESP Flash Programming Tool to flash the pre-built binary.
- Collect firmware log
- Use minicom or any similar terminal emulator with baud rate 115200 to fetch esp side logs on UART
$ minicom -D <serial_port>
serial_port is device where ESP chipset is detected. For example, /dev/ttyUSB0
Make sure that same code base (same git commit) is checked-out/copied at both, ESP and Host
- Note on Windows 11: you can follow these instructions, instead of the following, to setup ESP-IDF and build the esp firmware.
⚠️ Following command is dangerous. It will revert all your local changes. Stash if need to keep them.- Install the ESP-IDF using script
$ cd esp_hosted_fg/esp/esp_driver
$ cmake .
- Set-Up the build environment using
$ . ./esp-idf/export.sh
# Optionally, You can add alias for this command in ~/.bashrc for later use
- Set slave chipset environment
$ cd network_adapter
$ rm -rf sdkconfig build
$ idf.py set-target <esp_chipset>
For SDIO, <esp_chipset> could be esp32
- Execute following command to configure the project
$ idf.py menuconfig
- This will open project configuration window. To select SDIO transport interface, navigate to
Example Configuration -> Transport layer -> SDIO interface -> select
and exit from menuconfig. - Use below command to compile and flash the project. Replace <serial_port> with ESP peripheral's serial port.
$ idf.py -p <serial_port> build flash
- Collect the firmware log using
$ idf.py -p <serial_port> monitor
- Firmware log On successful flashing, you should see following entry in ESP log:
[ 77.877892] Features supported are:
[ 77.877901] * WLAN
[ 77.877906] * BT/BLE
[ 77.877911] - HCI over SDIO
[ 77.877916] - BT/BLE dual mode
- Host log
If the setup is functioning fine, you should receive
INIT
event from ESP chipset