zephyr: Add network module with WLAN support. - #19666
Open
VynDragon wants to merge 9 commits into
Open
Conversation
VynDragon
force-pushed
the
zephyr_wifi_pr
branch
from
August 28, 2026 18:03
e24cc18 to
6631f47
Compare
Add a network module to the zephyr port that supports wifi. Signed-off-by: Vdragon <mail@massdriver.space>
Revamp socket module and add a SSLContext implementation. Signed-off-by: Vdragon <mail@massdriver.space>
Allow relocating the MBedTLS heap. Signed-off-by: Vdragon <mail@massdriver.space>
Allow manually specifing a memory-region. Intended to workaround nonstandard linkage like espressif's. Signed-off-by: Vdragon <mail@massdriver.space>
Add a function to query system heap usage. Signed-off-by: Vdragon <mail@massdriver.space>
Store thread state in a safer way. Signed-off-by: Vdragon <mail@massdriver.space>
Select new features in mpconfig. Clean up prj.conf Add networking.conf describing configuration for network features. Signed-off-by: Vdragon <mail@massdriver.space>
VynDragon
force-pushed
the
zephyr_wifi_pr
branch
3 times, most recently
from
August 28, 2026 18:27
fe1479f to
f658266
Compare
Configure bflb boards to support wifi features. Signed-off-by: Vdragon <mail@massdriver.space>
Add an ESP32-C5 board. Signed-off-by: Vdragon <mail@massdriver.space>
VynDragon
force-pushed
the
zephyr_wifi_pr
branch
from
August 28, 2026 21:43
f658266 to
df54e0b
Compare
Contributor
Author
|
Thanks to @sylvioalves testing this and reporting it worked fine with the modifications he handed I have now applied, I figured what was 'wrong' with esp32c5:
The clone made a single functional change to the devkitc schematic: The board was browning out the entire time and requires one of those bridged out to work properly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add a network module that supports WLAN.
Add SSLContext support.
Revamp Socket module.
Add misc features supporting this (PSRAM stuffs, mbedtls, small utility to keep track of things).
Add ESP32-C5-DevKitC board.
The API matches documentation and often extend things to support Zephyr-specific features.
Testing
'Happy Path':
On:
(network functionalities: sort of Yes, Sockets and TLS: failed)works good now.Trade-offs and Alternatives
This is possibly necessary for Espressif support.However this reduces portability.Espressif doesn't work properly: The espressif network stack regularly interrupts execution and the memory organization is not sane, this confuses the micropython GC and results in crashes or things not working as expected / at all. I am not sure if it is a espressif issue, or if the implementation should be robust against this. For comparison, Bouffalolab WIFI6 is a Zephyr-native network stack. One possible solution is keeping every socket and network functions running in a purely zephyr context and instead queue events and queries from micropython context: This is simple for networking as it already works like that and another layer will have minimal effects, but for sockets this is much less practical.Generative AI
I did not use generative AI tools to write code for this PR.
I used generative AI tools to do research on sockets, documents micropython APIs (seriously it needs more comments, I struggled previously on this and AI is a crutch here), exploring the espressif elements, and debugging mbedtls configuration.
Made possible by donations from @josuah