Skip to content

IEEE 802.15.4 Examples and API Fixes#587

Open
tyler-potyondy wants to merge 3 commits intotock:masterfrom
tyler-potyondy:ieee802154-fixes
Open

IEEE 802.15.4 Examples and API Fixes#587
tyler-potyondy wants to merge 3 commits intotock:masterfrom
tyler-potyondy:ieee802154-fixes

Conversation

@tyler-potyondy
Copy link

@tyler-potyondy tyler-potyondy commented Dec 16, 2025

IEEE 802.15.4 Examples and API Fixes

This PR updates the libtock-rs 15.4 API to account for the Phy/Standard 15.4 drivers in the kernel.

For context, the kernel has two 15.4 driver interfaces (that are mutually exclusive): a standard 15.4 driver and a Phy driver. The standard driver accepts payloads and forms the frame (adding headers, handling encryption, etc.). The Phy driver takes a buffer and transmits this buffer without modification.

The existing 15.4 API uses the standard driver. However, this driver does not expose functionality for things such as setting the channel or tx power (resulting in the errors in #586).

Changes

  • Update 15.4 API to include transmit "raw" (using Phy driver).
  • Remove set channel / tx power from standard examples.
  • Add a "tx_raw" example.
  • Adds some more debug prints to the examples.

TODO

  • I only have one board with me currently so I need to test tx/rx functionality together with two boards. I'll ping once this is ready to merge on my end.
  • We should integrate the libtock-rs 15.4 examples into the 15.4/OpenThread Nightly CI test.

@tyler-potyondy
Copy link
Author

I realized that the existing libtock-rs implementation explicitly only uses the Phy kernel driver. I updated the PR to only mention/use the Phy interface and more explicitly call out this as the "raw" transmit. Does there exist a README with documentation on the examples?

@brghena brghena added the blocked Blocked on promised changes or other PRs label Dec 17, 2025
brghena
brghena previously approved these changes Dec 17, 2025
@tyler-potyondy
Copy link
Author

tyler-potyondy commented Dec 17, 2025

I've confirmed that the ieee802154_rx_raw, ieee802154_rx_raw, and ieee802154_rx_tx_raw tests are working.

When testing, I noticed some issues with the parsing logic (which have now been fixed). Should be good to merge on my end. I see some CI failures, but those look like they are not relevant to me?

@brghena brghena removed the blocked Blocked on promised changes or other PRs label Dec 18, 2025
@lschuermann
Copy link
Member

Hm, it really looks like we ought to have a Cargo.lock in this repository as well, @jrvanwhy?

error: rustc 1.88.0 is not supported by the following packages:
  smol_str@0.3.4 requires rustc 1.89
  typed-index-collections@3.4.0 requires rustc 1.90.0

@jrvanwhy
Copy link
Collaborator

Hm, it really looks like we ought to have a Cargo.lock in this repository as well, @jrvanwhy?

error: rustc 1.88.0 is not supported by the following packages:
  smol_str@0.3.4 requires rustc 1.89
  typed-index-collections@3.4.0 requires rustc 1.90.0

Or upgrade to edition 2024.

@tyler-potyondy
Copy link
Author

Ping on this PR. Is there anything blocking on me?

@jrvanwhy
Copy link
Collaborator

Oh, I was waiting for CI to pass before reviewing. I think that'll be a separate PR though (edition 2024 upgrade).

@tyler-potyondy
Copy link
Author

@jrvanwhy I can take a stab at a version upgrade sometime end of next week! (full disclaimer I'm not as familiar with libtock-rs so I'll need a more thorough review on those changes 🙂)

@potto216
Copy link
Contributor

potto216 commented Feb 4, 2026

Can we rerun the ci to see if the below error has gone away?

error: rustc 1.88.0 is not supported by the following packages:
  smol_str@0.3.4 requires rustc 1.89
  typed-index-collections@3.4.0 requires rustc 1.90.0
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.88.0

If not, how do you reproduce it to debug? I tried making a Dockerfile using the information in .github/workflows but was not able to get that error.

I have successfully built example programs using the PR branch locally without issue.

@jrvanwhy
Copy link
Collaborator

jrvanwhy commented Feb 4, 2026

I just looked and I don't think I have permission to re-run CI. Regardless, the underlying issue is not fixed (that our dependency specifications allow for our dependencies to update to versions that don't work on our MSRV), so I would expect it to fail again.

Is it possible that you're accidentally keeping a working Cargo.lock around? The CI starts with a fresh checkout with no Cargo.lock; if your copied your Cargo.lock into your Docker location then that would explain the success. If not, maybe an upstream package was yanked or updated to limit its dependencies in a way that prevents us from hitting this issue?

The easy fix to move this PR forward is to bump to resolver 3 (which makes cargo consider the Rust version during dependency resolution).

@potto216
Copy link
Contributor

potto216 commented Feb 11, 2026

@jrvanwhy thanks I was able to reproduce the error locally when I ran

cargo clean
rm -rf target/ Cargo.lock demos/st7789-slint/Cargo.lock
rm -rf ~/.cargo/registry ~/.cargo/git

Your suggestion worked to fix make demos. Below is my patch. @tyler-potyondy do you need to make the change?

user@ubuntu-node-01:~/workspace/tockos/pr/libtock-rs$ git diff
diff --git a/demos/st7789-slint/Cargo.toml b/demos/st7789-slint/Cargo.toml
index 17510ea..fb3c9e1 100644
--- a/demos/st7789-slint/Cargo.toml
+++ b/demos/st7789-slint/Cargo.toml
@@ -31,3 +31,4 @@ libtock_build_scripts = { path = "../../build_scripts" }
 slint-build = { git = "https://github.com/slint-ui/slint" }

 [workspace]
+resolver = "3"

@potto216
Copy link
Contributor

@tyler-potyondy #589 should fix the CI error

@potto216
Copy link
Contributor

@tyler-potyondy with #589 merged in did you want to see if you can get the CI to pass? I have a PR on the 802.15.4 examples that I would like to submit, but I'm using your code from this PR. Thanks again for the changes!

The kernel exposese two 15.4 drivers, a standard driver and a phy
driver. The standard driver takes a payload and other fields and forms
the headers/handles encryption. The phy driver transmits "raw" payloads.

- Update naming of examples / functions to specify using raw interface.
The ieee802154_rx_raw and ieee802154_rx_tx apps expect a packet of the
form "frame XXXX" where XXXX encodes the frame number using the last
four bytes.

This fixes the parsing logic to correctly display this information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants