arch/xtensa: properly set carrier on/off on espnow driver#18778
Open
fdcavalcanti wants to merge 1 commit intoapache:masterfrom
Open
arch/xtensa: properly set carrier on/off on espnow driver#18778fdcavalcanti wants to merge 1 commit intoapache:masterfrom
fdcavalcanti wants to merge 1 commit intoapache:masterfrom
Conversation
In esp_espnow_pktradio.c, after ESP-NOW is successfully initialized in espnow_ifup, call netdev_carrier_on(dev). In espnow_ifdown, call netdev_carrier_off(dev). Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
xiaoxiang781216
approved these changes
Apr 22, 2026
eren-terzioglu
approved these changes
Apr 23, 2026
Laczen
approved these changes
Apr 26, 2026
jerpelea
approved these changes
Apr 27, 2026
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
In esp_espnow_pktradio.c, after ESP-NOW is successfully initialized in espnow_ifup, call netdev_carrier_on(dev).
In espnow_ifdown, call netdev_carrier_off(dev).
NuttX only sets IFF_RUNNING (carrier) when the driver calls netdev_carrier_on(). The ESP-NOW 6LoWPAN interface came up with IFF_UP but without RUNNING, so the stack still treated wpan0 as “not running.” That broke UDP paths that require IFF_IS_RUNNING (e.g. DHCPC over the interface) and other behavior that keys off “RUNNING” in ifconfig. Other radio/6LoWPAN drivers (e.g. xbee) already use the same netdev_carrier_on / netdev_carrier_off pairing.
Impact
Impact on user: Yes. Fixes
espnowfunctionality.Impact on build: No.
Impact on hardware: Only affects ESP32.
Impact on documentation: No.
Impact on security: No.
Impact on compatibility: No.
Testing
espnow two-board serial tests passed after the change (previous failure showed wpan0 as UP but not RUNNING; UDP/DHCP then failed on “device is not running”).
Building
./tools/configure.sh esp32-devkitc:espnowRunning
Execute the example available on the documentation.
On the board running as server:
ifconfig wpan0 inet6 fe80::ff:fe00:audpserver &On the client:
udpclient fe80::ff:fe00:a &Results
Before changes:
No data was received on server side and had errors related to network interface.
After changes:
Data exchanged as expected.