Skip to content

at86rf2xx: implement Basic Mode#12070

Closed
jia200x wants to merge 5 commits intoRIOT-OS:masterfrom
jia200x:pr/at86rf2xx_basic_mode_op
Closed

at86rf2xx: implement Basic Mode#12070
jia200x wants to merge 5 commits intoRIOT-OS:masterfrom
jia200x:pr/at86rf2xx_basic_mode_op

Conversation

@jia200x
Copy link
Copy Markdown
Member

@jia200x jia200x commented Aug 23, 2019

Contribution description

This adds support for Basic Mode operation (no auto-ack, no
auto-retrans with CSMA).
A new configuration flag is added for setting the default
operation mode. However, the device can switch between modes
on runtime (see AT86RF2XX_OPT_EXT_MODE option).

By default, the device is set to Extended Operation.

Testing procedure

Test with a couple of nodes. Set one to extended mode and the other one to basic:
E.g

CFLAGS=-DCONFIG_AT86RF2XX_DEFAULT_MODE=AT86RF2XX_MODE_BASIC BOARD=iotlab-m3 make all flash term

and

BOARD=iotlab-m3 make all flash term

Send packets from BASIC->EXTENDED. You should see an ACK packet (8 bytes with netif_hdr) in the BASIC node:

1566572302.955737;m3-11;> txtsnd 4 15:11:6B:10:65:FC:BD:52 holi
1566572302.957690;m3-11;> PKTDUMP: data received:
1566572302.957966;m3-10;> PKTDUMP: data received:
1566572302.958641;m3-11;~~ SNIP  0 - size:   0 byte, type: NETTYPE_UNDEF (0)
1566572302.960005;m3-10;~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
1566572302.960198;m3-10;00000000  68  6F  6C  69
1566572302.960334;m3-10;~~ SNIP  1 - size:  18 byte, type: NETTYPE_NETIF (-1)
1566572302.961037;m3-10;if_pid: 4  rssi: -46  lqi: 255
1566572302.961192;m3-10;flags: 0x0
1566572302.961774;m3-11;00000000~~ SNIP  1 - size:   8 byte, type: NETTYPE_NETIF (-1)
1566572302.961953;m3-11;if_pid: 4  rssi: -46  lqi: 255
1566572302.962089;m3-11;flags: 0x0
1566572302.962249;m3-10;src_l2addr: AD:56
1566572302.962370;m3-10;dst_l2addr: 15:11:6B:10:65:FC:BD:52
1566572302.963227;m3-11;src_l2addr: (nil)
1566572302.963729;m3-11;dst_l2addr: (nil)
1566572302.964136;m3-11;~~ PKT    -  2 snips, total size:   8 byte
1566572302.964533;m3-10;~~ PKT    -  2 snips, total size:  22 byte

Send from EXTENDED->BASIC. You should see the retransmission packets on BASIC:

1566572246.940421;m3-10;> txtsnd 4 15:11:6B:10:65:FC:AD:56 holi
1566572246.944401;m3-11;> PKTDUMP: data received:
1566572246.944594;m3-11;~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
1566572246.944733;m3-11;00000000  68  6F  6C  69
1566572246.945702;m3-11;~~ SNIP  1 - size:  18 byte, type: NETTYPE_NETIF (-1)
1566572246.946942;m3-11;if_pid: 4  rssi: -45  lqi: 255
1566572246.947133;m3-11;flags: 0x0
1566572246.948295;m3-11;src_l2addr: BD:52
1566572246.948472;m3-11;dst_l2addr: 15:11:6B:10:65:FC:AD:56
1566572246.949881;m3-11;~~ PKT    -  2 snips, total size:  22 byte
1566572246.950059;m3-11;PKTDUMP: data received:
1566572246.950551;m3-11;~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
1566572246.951460;m3-11;00000000  68  6F  6C  69
1566572246.952444;m3-11;~~ SNIP  1 - size:  18 byte, type: NETTYPE_NETIF (-1)
1566572246.953410;m3-11;if_pid: 4  rssi: -45  lqi: 255
1566572246.953588;m3-11;flags: 0x0
1566572246.953713;m3-11;src_l2addr: BD:52
1566572246.954456;m3-11;dst_l2addr: 15:11:6B:10:65:FC:AD:56
1566572246.955447;m3-11;~~ PKT    -  2 snips, total size:  22 byte
1566572246.956426;m3-11;PKTDUMP: data received:
1566572246.957399;m3-11;~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
1566572246.957578;m3-11;00000000  68  6F  6C  69
1566572246.958500;m3-11;~~ SNIP  1 - size:  18 byte, type: NETTYPE_NETIF (-1)
1566572246.959442;m3-11;if_pid: 4  rssi: -45  lqi: 255
1566572246.959607;m3-11;flags: 0x0
1566572246.960428;m3-11;src_l2addr: BD:52
1566572246.961398;m3-11;dst_l2addr: 15:11:6B:10:65:FC:AD:56
1566572246.962408;m3-11;~~ PKT    -  2 snips, total size:  22 byte
1566572246.962574;m3-11;PKTDUMP: data received:
1566572246.963450;m3-11;~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
1566572246.964425;m3-11;00000000  68  6F  6C  69
1566572246.965401;m3-11;~~ SNIP  1 - size:  18 byte, type: NETTYPE_NETIF (-1)
1566572246.966344;m3-11;if_pid: 4  rssi: -45  lqi: 255
1566572246.966780;m3-11;flags: 0x0
1566572246.967168;m3-11;src_l2addr: BD:52
1566572246.967685;m3-11;dst_l2addr: 15:11:6B:10:65:FC:AD:56
1566572246.968635;m3-11;~~ PKT    -  2 snips, total size:  22 byte


Issues/PRs references

Depends on #12069
Partially addresses #8213

@jia200x jia200x added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers labels Aug 23, 2019
@jia200x jia200x added the State: waiting for other PR State: The PR requires another PR to be merged first label Aug 23, 2019
@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Aug 23, 2019

@roberthartung might be interested on this one

This commit removes the SLEEP state and adds a dedicated function for
turning the radio on and off. The motivation for removing the SLEEP
state is to simplify the state machine of `at86rf2xx_set_state`
@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Aug 27, 2019

I forgot to fix the TX_DONE event here. In Basic Mode, it's not necessary to read the TRX_STATUS register

This change defines PHY states for the radio. Although the internal
states differ between Basic Mode and Extended Mode operation, they have
an equivalent in PHY states (e.g RX_AACK_ON is equivalent to RX_ON).
With this it will be easier to implement Basic Mode support for this
radio
Due to the design of netdev, it's more convenient to use static buffer
protection instead of dynamic. As soon as the frame buffer is accessed,
the SFD detection is disabled until the whole recv procedure finished
(dropping or fetching from FB). This way it's not necessary to switch to
PLL_ON mode on reception.
The current driver SPI polls the states of the transceiver. This doesn't
prevent race conditions to happen, since these states are very volatile.
With this change the PHY states of the transceiver are represented with
the `dev->state` variable, which syncs to the device via interrupts.
Now it's possible to safely check if the device is busy without chances
of race conditions.
This adds support for Basic Mode operation (no auto-ack, no
auto-retrans with CSMA).
A new configuration flag is added for setting the default
operation mode. However, the device can switch between modes
on runtime (see `AT86RF2XX_OPT_EXT_MODE` option)
@jia200x jia200x force-pushed the pr/at86rf2xx_basic_mode_op branch from 0e97caf to b8947b7 Compare August 27, 2019 13:51
@roberthartung
Copy link
Copy Markdown
Member

@jia200x Certainly interested, but currently (This and next week) out of capacity.

@fjmolinas
Copy link
Copy Markdown
Contributor

@jia200x is this still wip? Can you give it a rebase?

@jia200x
Copy link
Copy Markdown
Member Author

jia200x commented Mar 12, 2020

@fjmolinas I will close this one for now. We would eventually get the basic mode for free with the SubMAC + radio HAL.

I will re-open if needed

@jia200x jia200x closed this Mar 12, 2020
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 State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants