-
Notifications
You must be signed in to change notification settings - Fork 2.1k
drivers/netdev_ieee802154_submac: fix bytes_tx #21796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
crasbe
merged 2 commits into
RIOT-OS:master
from
morigawa:pr/netdev_ieee802154_submac_fix_bytestx
Oct 31, 2025
Merged
drivers/netdev_ieee802154_submac: fix bytes_tx #21796
crasbe
merged 2 commits into
RIOT-OS:master
from
morigawa:pr/netdev_ieee802154_submac_fix_bytestx
Oct 31, 2025
+10
−2
Conversation
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
Contributor
|
There is a |
mguetschow
reviewed
Oct 22, 2025
fabian18
reviewed
Oct 23, 2025
Contributor
|
Looks good I think you can squash |
b456d7f to
ebb4881
Compare
benpicco
approved these changes
Oct 31, 2025
Contributor
|
Looks like this needs a rebase onto the latest |
bytes_tx should not be set to 0 at this point. It should be set to the length of the package, if there is an error after transmission it will be set to an error value in submac_tx_done. The value will be evaluated after a TX_DONE Event, so the pending state 0 that is returned from the _send function while async sending, is not relevant for bytes_tx.
Using OT_ERROR_FAILED let to unreachable code and following that a panic.
auto-merge was automatically disabled
October 31, 2025 19:42
Head branch was pushed to by a user without write access
ebb4881 to
073d165
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: drivers
Area: Device drivers
Area: network
Area: Networking
Area: pkg
Area: External package ports
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
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.
Contribution description
The OpenThread example didn't work for nrf52840 based boards (adafruit feather sense, nrf52840dk). The problem is that the bytes_tx value in the submac netdev (established in #20992), was not working correctly. It only could return 0 or a negative value for errors. bytes_tx should return the length of the packet or an error. Because bytes_tx is only evaluated after a TX_DONE event, it shouldn't return 0 in a reasonable case. If this for some reason does happen, otPlatRadioTxDone should be called with OT_ERROR_ABORT instead of OT_ERROR_FAILED. In the case of OT_ERROR_FAILED, "unreachable" code is reached and this causes a panic.
Testing procedure
Because there is currently a problem with the nrf driver in master (#21782), I cherry-picked the commits onto a previous state and tested them on a nrf52840dk.
Issues/PRs references
See also #20992
Depends on #21786