Skip to content

Conversation

@iabdalkader
Copy link
Contributor

@iabdalkader iabdalkader commented Jan 29, 2026

The latest stable ESP-hosted firmware (v1.0.0.0.0) is no longer backward compatible with Zephyr's host driver. The main breaking change is the ConnectAP response changing from a synchronous response to an asynchronous event. This is a good change and it's in line with other requests, but it breaks backward compatibility.

This PR adds support for the latest firmware while maintaining support for the legacy firmware (v0.0.5) shipped with some boards, via a config option. Moving forward, if ESP ever releases an update, the host driver in Zephyr should by default support the latest firmware.

Note: The latest firmware also introduces new features, such as set/get country code, band argument in requests and responses, uid for frames and some additional events. This PR does not attempt to support every new feature, but just the base functionality.

@iabdalkader iabdalkader force-pushed the esp_hosted_updated branch 2 times, most recently from 8ea205c to 693bdfb Compare January 29, 2026 14:43
Comment on lines 25 to 26
config WIFI_ESP_HOSTED_LEGACY
bool "Support legacy (<= v0.0.5) firmware"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should in my option come from the devicetree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note it's not just a runtime option, the option changes which protocol file gets used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in zephyr the devicetree is also constant, unlike to linux.

you could for example use

https://docs.zephyrproject.org/latest/build/kconfig/preprocessor-functions.html

$(dt_compat_all_has_prop,<compatible string>,<prop>[,<value>])
$(dt_compat_any_has_prop,<compatible string>,<prop>[,<value>])

to access a value from the dt.

Copy link
Contributor Author

@iabdalkader iabdalkader Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But can I check in CMakeLists.txt? That's where the protocol file is switched. I guess it's possible, but other than that, any good reason for that? I mean the config option is working perfectly fine, and it's been tested with both old/new firmware.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But can I check in CMakeLists.txt?

yes

The point is, that the devicetree should contain all necessary information about the hardware. The right way would be to have two different compatibles, as both versions are not compatible with each other.

btw you can still use a Kconfig as a intermediate, that is set by the dt.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see https://docs.zephyrproject.org/latest/build/dts/dt-vs-kconfig.html

The software version of esp-hosted on the remote esp32 would be considered a hardware property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let me give it a try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The software version of esp-hosted on the remote esp32 would be considered a hardware property.

I'm honestly not sure, I think it's a gray area, but I don't mind changing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. I think this is what you meant.

@iabdalkader iabdalkader force-pushed the esp_hosted_updated branch 2 times, most recently from 8732c7e to 8f68d01 Compare January 29, 2026 16:46
@zephyrbot zephyrbot added area: Devicetree Binding PR modifies or adds a Device Tree binding area: Boards/SoCs labels Jan 29, 2026
Rename legacy esp-hosted protobuf protocol file, and add the
latest protocol.

Signed-off-by: Ibrahim Abdalkader <[email protected]>
Add support for esp-hosted v1.0.0.0.0 firmware.

Signed-off-by: Ibrahim Abdalkader <[email protected]>
Use legacy esp-hosted firmware protocol.

Signed-off-by: Ibrahim Abdalkader <[email protected]>
@sonarqubecloud
Copy link

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

Labels

area: Boards/SoCs area: Devicetree Binding PR modifies or adds a Device Tree binding area: Wi-Fi Wi-Fi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants