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

IEEE802.15.4 support for nrf52 #11617

Merged
merged 4 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
arch/nrf52: add initial support for IEEE 802.15.4
Supported features:

- frame transmition
- frame reception and filtering
- immediate ACK (incoming and outgoing)
- promiscuous mode
- delayed transmision
- radio events trace
- setting pending bit for all incoming Data Request frames
- un-slotted CSMA-CA

Work in progres features (some logic is present, but they require more work):

- beacon transmision (periodic transmition works, but requires verification)
- slotted CSMA-CA
- GTS

Fetures not implemented:

- enhanced ACK (Enh-ACK)
- enhanced beacon
- low power mode
- advanced features from IEEE 802.15.4e (DSME, TSCH)

Added examples for boards:

- nrf52832-dk: mrf24j40_6lowpan
- nrf52832-dk: mrf24j40_mac
- nrf52840-dk: ieee802154_6lowpan
- nrf52840-dk: ieee802154_mac
- nrf52840-dongle: ieee802154_mac
- nrf9160-dk-nrf52: ieee802154_6lowpan
- nrf9160-dk-nrf52: ieee802154_mac
  • Loading branch information
raiden00pl committed Feb 18, 2024
commit 0dce7c9d4eeee01fe7ea3911444a5611659bfa45
17 changes: 17 additions & 0 deletions Documentation/platforms/arm/nrf52/boards/nrf52840-dk/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,20 @@ usbnsh
------

Basic NuttShell configuration (CDCACM console enabled in USB Port, at 115200 bps).

ieee802154_6lowpan
------------------

Cheat Sheet. Here is a concise summary of all all the steps needed to
run the UDP test (C=Coordinator; E=Endpoint)::

C: nsh> i8 wpan0 startpan cd:ab
C: nsh> i8 set saddr 0A:00
C: nsh> i8 set ep_saddr 0B:00
C: nsh> i8 acceptassoc
E: nsh> i8 wpan0 assoc
C: nsh> ifup wpan0
C: nsh> ifconfig <-- To get the <server-ip>
E: nsh> ifup wpan0
C: nsh> udpserver &
E: nsh> udpclient <server-ip> &
44 changes: 44 additions & 0 deletions Documentation/platforms/arm/nrf52/ieee802154.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
==========================
Nordic nRF52 IEEE 802.15.4
==========================

.. note::

This driver is highly experimental.
Help with development and testing will be appreciated ;)

Supported features:

* frame transmission
* frame reception and filtering
* immediate ACK (incoming and outgoing)
* promiscuous mode
* delayed transmision
* radio events trace
* setting pending bit for all incoming Data Request frames
* un-slotted CSMA-CA

Work in progres features (some logic is present, but they require more work):

* beacon transmision (periodic transmition works, but requires verification)
* slotted CSMA-CA
* GTS

Fetures not implemented:

* enhanced ACK (Enh-ACK)
* enhanced beacon
* low power mode
* advanced features from IEEE 802.15.4e (DSME, TSCH)

Reserved peripherals
====================

This implementation reserves the following peripherals:

* ``RADIO`` - used for radio operations

* ``TIMER0`` - used as high resolution timer for ACK, IFS and other radio delays

* ``RTC0`` - if superframe support is enabled, used as low power timer to hande
superframe events
14 changes: 10 additions & 4 deletions Documentation/platforms/arm/nrf52/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Peripheral Support

The following list indicates peripherals supported in NuttX:

========== ======= =====
========== ======= ===============
Peripheral Support Notes
========== ======= =====
========== ======= ===============
GPIO Yes
GPIOTE Yes
I2S No
Expand All @@ -64,7 +64,7 @@ PPI Yes
PWM Yes
QDEC No
QSPI Yes
RADIO Yes Basic
RADIO Yes BLE, IEEE 802.15.4
RNG Yes
RTC Yes
SAADC Yes
Expand All @@ -78,7 +78,7 @@ UART Yes
UARTE No
USBD Yes
WDT Yes
========== ======= =====
========== ======= ===============

Peripherals such as AAR, ACL, CCM, ECB are not directly used by NuttX since they
are part of BLE controller implementation (link).
Expand Down Expand Up @@ -206,6 +206,11 @@ is provided with settings already set.
Note that in this case, some peripherals (mostly those related to BLE) will be unavailable. Some PPI
channels will also be ocuppied (``NRF52_PPI_NUM_CONFIGURABLE_CHANNELS`` will be set accordingly in this case).

IEEE 802.15.4 Support
=====================

Details about IEEE 802.15.4 support for nRF52 can be found in :doc:`ieee802154`.

Supported Boards
================

Expand All @@ -214,3 +219,4 @@ Supported Boards
:maxdepth: 1

boards/*/*
ieee802154.rst
14 changes: 14 additions & 0 deletions arch/arm/src/nrf52/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ endif()

if(CONFIG_NRF52_RADIO)
list(APPEND SRCS nrf52_radio.c)

if(CONFIG_NRF52_RADIO_IEEE802154)
list(APPEND SRCS nrf52_ieee802154_radio.c)
list(APPEND SRCS nrf52_ieee802154_tim.c)
list(APPEND SRCS nrf52_ieee802154.c)

if(CONFIG_NRF52_RADIO_IEEE802154_SUPERFRAME)
list(APPEND SRCS nrf52_ieee802154_rtc.c)
endif()

if(CONFIG_NRF52_RADIO_IEEE802154_TRACE)
list(APPEND SRCS nrf52_ieee802154_trace.c)
endif()
endif()
endif()

if(CONFIG_NRF52_TIMER)
Expand Down
34 changes: 34 additions & 0 deletions arch/arm/src/nrf52/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,40 @@ config NRF52_RADIO_CUSTOM
bool "RADIO uses custom IRQ handlers"
default n

config NRF52_RADIO_IEEE802154
bool "RADIO IEEE802.15.4 protocol"
default n
depends on NRF52_HAVE_IEEE802154
select ARMV7M_USEBASEPRI
select ARCH_RAMVECTORS
select ARCH_IRQPRIO
select NRF52_RADIO_CUSTOM
select NRF52_TIMER0

if NRF52_RADIO_IEEE802154

config NRF52_RADIO_IEEE802154_SUPERFRAME
bool "RADIO IEEE802.15.4 superframe support"
default n
select NRF52_RTC0
select NRF52_USE_LFCLK

config NRF52_RADIO_IEEE802154_GTS_SLOTS
int "RADIO IEEE802.15.4 GTS slots"
default 2
depends on NRF52_RADIO_IEEE802154_SUPERFRAME

config NRF52_RADIO_IEEE802154_TRACE
bool "RADIO IEEE802.15.4 trace support"
default n

config NRF52_RADIO_IEEE802154_TRACE_BUFSIZE
int "RADIO IEEE802.15.4 trace buffer size"
depends on NRF52_RADIO_IEEE802154_TRACE
default 1024

endif

endif #NRF52_RADIO

endmenu # "RADIO Configuration"
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/src/nrf52/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ endif

ifeq ($(CONFIG_NRF52_RADIO),y)
CHIP_CSRCS += nrf52_radio.c
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154),y)
CHIP_CSRCS += nrf52_ieee802154_radio.c
CHIP_CSRCS += nrf52_ieee802154_tim.c
CHIP_CSRCS += nrf52_ieee802154.c
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154_SUPERFRAME),y)
CHIP_CSRCS += nrf52_ieee802154_rtc.c
endif
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154_TRACE),y)
CHIP_CSRCS += nrf52_ieee802154_trace.c
endif
endif
endif

ifeq ($(CONFIG_NRF52_TIMER),y)
Expand Down
Loading