-
Notifications
You must be signed in to change notification settings - Fork 2k
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/at86rf215: Add driver for the AT86RF215 dual-band IEEE 802.15.4-2015 radio #12128
Conversation
369990b
to
791f334
Compare
I can try to help with the testing on the openmote. I really don't deal that much with radios but can do my best! |
I know the sub-GHz was wanted for quite some time. It would be nice to support it. |
rebased to the changes made in #12171 @MrKevinWeiss Is there a data sheet for the openmote-b somewhere, so I can already prepare a setup for you to test? |
The best I can do is email you the schematics... I don't know if they are public though so if you email me [email protected] I can forward them. |
dbf0718
to
d477617
Compare
dfebf8c
to
209b2ac
Compare
Rebased to include #12295 so the build on AVR will not fail due to the added case in |
Let's say I have 2 OpenMote B nodes and I'd want to run a quick test, then how would you suggest I do that? @benpicco |
@tinstructor Then when you run If you ping the other node using the link-local address you have to make sure to specify the interface over which you want to reach it, so e.g You can use Of course you have to have the same settings on both nodes for them to be able to communicate 😉 |
@benpicco I don't seem to be able to get a response and I'm sure both nodes have the same config. However, is it possible that I first need to set the TX-Power and radio states? Also how can I see which interface is 2.4GHz/Sub-GHz respectively? |
You shouldn't need to configure anything, they default to legacy O-QPSK on both interfaces for compatibility with 802.15.4-2003. Can you post your Also, try |
The internal oscillator can be tuned by adding up to 16*0.3pF to the RC circuit. To do so connect a frequency counter to the chip's clock output (and set AT86RF215_USE_CLOCK_OUTPUT to 1), then tune the value until the measured frequency is closest to 26 MHz. This should improve the radio characteristics of the transceiver.
If the device is in deep sleep it will not answer to reads of the PN register. We have to reset it before.
#13598 should fix the issues on the |
@benpicco Regarding #12128 (comment) - Fragmentation should not be an issue of the radio driver. If higher layers need fragmentation, this should be handled on higher layers, not here! There should be a higher level queue for this purpose. |
The driver does not handle fragmentation. It will just ensure that
#11263 would implement this. |
we want to keep the diff small.
When the radio is in DEEP SLEEP, reading the state register will return 0. This makes the reset routine abort early even though the device is connected and still waking up. Instead, just add a timeout to the polling of the WAKEUP IRQ bit. In practise it has shown that the loop will be taken two times on 'normal' reset and four times when the radio was in DEEP SLEEP. Polling 255 times sure does not hurt. To reproduce the issue, put both interfaces into SLEEP mode, then reboot the module: ifconfig 7 set state sleep ifconfig 8 set state sleep reboot
@benpicco are there futures in this PR still missing in master? |
TODO but not implemented anywhere:
|
All features from this PR have now been split off to separate PRs or have been merged. |
Contribution description
This adds a driver for the SPI based AT86RF215 transceiver.
The chip supports the IEEE 802.15.4-2015 and IEEE 802.15.4g-2012 standard.
This driver supports two versions of the chip:
The AT86RF215 behaves like two chips in one package. There is a radio fronted and a baseband controller for both bands and they operate independently. They share the SPI interface and IRQ pin, it is the necessary to check the interrupt status registers to find out which of the two radios caused the interrupt. Each interface is an independent
netdev_ieee802154
.Both radios support the following PHY modes:
All modulations are implemented and configurable through
ifconfig
.The driver defaults to O-QPSK (legacy) at 250 kb/s on both bands for compatibility with existing 802.15.4 devices.
Each radio has a separate RX and TX framebuffer that can hold 2047 bytes each. The device is able to transmit 2047 byte frames according to IEEE 802.15.4g-2012 when operating in non-legacy mode.
The larger frame size is automatically used by RIOT when switching to such mode.
What works:
ifconfig set page
ifconfig set state sleep
/ifconfig set state idle
)Whhat's missing:
proper interface to configure modulationdriver should handleping6 -i 0
as graceful asat86rf2xx
- currently all packets but one are dropped. (-i
>= 10 ms works fine)Testing procedure
An example configuration is provided for connecting the ATREB215-XPRO module to EXT3 on the same54-xpro evaluation board.
Configuration for EXT1 on samr21-xpro
Configuration for esp32-wroom-32 with a bunch of wires
In
examples/gnrc_networking
add the following to the Makefile:You should now be able to communicate with other 802.15.4 radios.
(Tested with samr21-xpro (at86rf2xx) and mrf24j40 as communication partners)
OpenMote-B
The OpenMote-B board is supported by RIOT and contains an at86rf215 chip.
I do not have that hardware and could not find proper documentation, but I provided a configuration anyway based on the OpenWSN-fw code. This is entirely untested.
@MrKevinWeiss kindly provided me with documentation, this revealed that defines regarding the antenna switch were wrongly named. Sub-GHz is always connected to the at86rf215 whereas 2.4 GHz can be switched between cc2538 and at86rf215.
With this PR, at86rf215 will always be used for both sub-GHz and 2.4 GHz.
TODO
Channel Pages / Modulation selectionThe device provides 3 different PHY modes that all come with different options.
IEEE 802.15.4-2012g Amendment 3: Physical Layer (PHY) Specifications for LowData-Rate, Wireless, Smart Metering Utility Networks puts those modes to channel pages 9 & 10, but introduces 'sub-fields' to select the modulation & mode. The standard does not provide a nice numerical mapping though (or I did not find it?) and I honestly have no idea how to map this to the channel page used in Riot.
I now added options to
ifconfig
to configure the PHY modes and modulation options individually.Since they depend on the modulation, the values for getting/setting txpower are also somewhat bogus right now.
Issues/PRs references
#12082 allows for a small optimization where we can route the interrupt to the sibling device that last called
_send()
. This may save us the wake-up of the other thread in the common case.