Skip to content
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

drivers/at86rf2xx: setting rx timestamp based on symbol counter for ATmega*RFR2 #19605

Merged
merged 1 commit into from
May 19, 2023

Conversation

chudov
Copy link
Contributor

@chudov chudov commented May 17, 2023

Contribution description

The PR adds setting the 802.15.4 packet reception timestamp based on the symbol counter available in ATmega64/128/256RFR2 MCU. The counter restarts every ~19 hours.

To enable the feature the USEMODULE += gnrc_netif_timestamp needs to be added to a Makefile.

Testing procedure

The tests/net/gnrc_netif_iee802154 was updated to check the behavior on real boards.
The test was performed on derfmega256 and nrf52840dongle boards:

Two commands txtsnd 4 bcast test issued on nrf52840dongle 10 seconds apart, lead to the following result on the derfmega256:

PKTDUMP: data received:
~~ SNIP 0 - size: 4 byte, type: NETTYPE_UNDEF (0)
00000000 74 65 73 74
~~ SNIP 1 - size: 20 byte, type: NETTYPE_NETIF (-1)
if_pid: 4 rssi: -25 timestamp: 769.117280000 lqi: 65
flags: BROADCAST TIMESTAMP
src_l2addr: 74:13
dst_l2addr: FF:FF
~~ PKT - 2 snips, total size: 24 byte
PKTDUMP: data received:
~~ SNIP 0 - size: 4 byte, type: NETTYPE_UNDEF (0)
00000000 74 65 73 74
~~ SNIP 1 - size: 20 byte, type: NETTYPE_NETIF (-1)
if_pid: 4 rssi: -25 timestamp: 779.221568000 lqi: 65
flags: BROADCAST TIMESTAMP
src_l2addr: 74:13
dst_l2addr: FF:FF
~~ PKT - 2 snips, total size: 24 byte

The received packets have TIMESTAMP flag and the timestamps differ by 10 seconds.

The same command issued on derfmega256 board leads to similar printout on nrf52840dongle board, but as its driver doesn't have timestamp handling, the packet has no TIMESTAMP flag and the value in the timestamp field is random.

PKTDUMP: data received:
~~ SNIP 0 - size: 4 byte, type: NETTYPE_UNDEF (0)
00000000 74 65 73 74
~~ SNIP 1 - size: 20 byte, type: NETTYPE_NETIF (-1)
if_pid: 4 rssi: -72 timestamp: 26079.041421312 lqi: 156
flags: BROADCAST
src_l2addr: 6B:09
dst_l2addr: FF:FF
~~ PKT - 2 snips, total size: 24 byte
PKTDUMP: data received:
~~ SNIP 0 - size: 4 byte, type: NETTYPE_UNDEF (0)
00000000 74 65 73 74
~~ SNIP 1 - size: 20 byte, type: NETTYPE_NETIF (-1)
if_pid: 4 rssi: -56 timestamp: 26079.041421312 lqi: 160
flags: BROADCAST
src_l2addr: 6B:09
dst_l2addr: FF:FF
~~ PKT - 2 snips, total size: 24 byte

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework Platform: AVR Platform: This PR/issue effects AVR-based platforms labels May 17, 2023
@chudov chudov force-pushed the driver/at86rf2xx_packet_timestamp branch 3 times, most recently from 35a6de0 to 595eef4 Compare May 17, 2023 14:10
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 17, 2023
@riot-ci
Copy link

riot-ci commented May 17, 2023

Murdock results

✔️ PASSED

c52f6e7 drivers/at86rf2xx: rx timestamp generation for ATmegaRFR2

Success Failures Total Runtime
6946 0 6946 10m:04s

Artifacts

@chudov chudov force-pushed the driver/at86rf2xx_packet_timestamp branch 2 times, most recently from ac6a3e7 to c52f6e7 Compare May 19, 2023 13:32
Signed-off-by: chudov <chudov@gmail.com>
@maribu
Copy link
Member

maribu commented May 19, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented May 19, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit a46b49a into RIOT-OS:master May 19, 2023
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants