-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=miri64 a=jia200x 19691: drivers/bmx055: fix crazy use of FPU r=maribu a=maribu ### Contribution description As the title says... 19694: tests/drivers/epd_bw_spi_disp_dev: fix accidental use of FPU r=maribu a=maribu Co-authored-by: Jose Alamos <[email protected]> Co-authored-by: Marian Buschsieweke <[email protected]>
- Loading branch information
Showing
31 changed files
with
3,203 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# name of your application | ||
APPLICATION = opendsme_example | ||
|
||
# If no BOARD is found in the environment, use this default: | ||
BOARD ?= nrf52840dk | ||
|
||
# DSME uses beacon transmission, which are usually filtered out in current drivers. | ||
# So far, nrf802154 is the only driver that supports beacons, which means openDSME | ||
# will run only in nrf802154-based CPUs. | ||
FEATURES_REQUIRED += cpu_nrf52 | ||
|
||
# This has to be the absolute path to the RIOT base directory: | ||
RIOTBASE ?= $(CURDIR)/../.. | ||
|
||
# Uncomment these lines if you want to use platform support from external | ||
# repositories: | ||
#RIOTCPU ?= $(CURDIR)/../../../thirdparty_cpu | ||
#EXTERNAL_BOARD_DIRS ?= $(CURDIR)/../../../thirdparty_boards | ||
|
||
# Uncomment this to enable scheduler statistics for ps: | ||
#CFLAGS += -DSCHEDSTATISTICS | ||
|
||
# If you want to use native with valgrind, you should recompile native | ||
# with the target all-valgrind instead of all: | ||
# make -B clean all-valgrind | ||
|
||
# Comment this out to disable code in RIOT that does safety checking | ||
# which is not needed in a production environment but helps in the | ||
# development process: | ||
DEVELHELP ?= 1 | ||
|
||
# Change this to 0 show compiler invocation lines by default: | ||
QUIET ?= 1 | ||
|
||
USEMODULE += ps | ||
USEMODULE += shell | ||
USEMODULE += shell_cmds_default | ||
|
||
USEPKG += opendsme | ||
USEMODULE += auto_init_gnrc_netif | ||
USEMODULE += l2util | ||
USEMODULE += gnrc_pktdump | ||
USEMODULE += gnrc_txtsnd | ||
|
||
USEMODULE += netdev_default | ||
|
||
# Some boards (e.g nrf52840dongle) require a higher CCA threshold to avoid | ||
# false positives. | ||
CFLAGS += -DCONFIG_IEEE802154_CCA_THRESH_DEFAULT=-30 | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BOARD_INSUFFICIENT_MEMORY := \ | ||
nrf52dk \ | ||
nrf52840dk \ | ||
nrf52840dongle \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# About openDSME | ||
|
||
The IEEE 802.15.4 standard with its widespread usage in wireless sensor and | ||
actuator networks was extended by several techniques that allow reliable data | ||
transmission for critical applications, such as industrial plants. This | ||
includes the Deterministic and Synchronous Multi-channel Extension (DSME) that | ||
allows for distributed assignment of time slots on multiple channels. | ||
|
||
openDSME is an open source implementation of the Deterministc and | ||
Synchronous Multi-channel Extension. | ||
|
||
## Features | ||
|
||
- Topology agnostic (peer-to-peer, star, mesh, etc). | ||
- By design, a DSME network can be extended just by adding more coordinators near the edge. | ||
- Automatic resolution of beacon collision | ||
- Frame transmission using either CSMA-CA or multi-channel GTS (guaranteed time slot) | ||
- Built-in slot negotiation (dynamic allocation) and static allocation. | ||
|
||
# Usage | ||
1. A PAN coordinator device starts the DSME network via the GNRC network interface: | ||
``` | ||
ifconfig <if_num> pan_coord | ||
ifconfig <if_num> up | ||
``` | ||
|
||
2. Child devices trigger scanning and join the DSME network: | ||
``` | ||
ifconfig <if_num> up | ||
``` | ||
|
||
3. On a fraction of second, `ifconfig` of the joining child device | ||
should display "Link: up" and the L2 address should be visible | ||
|
||
4. Devices may choose CSMA-CA or GTS transmissions. CSMA-CA transmissions are | ||
selected by default. To switch to GTS transmissions, run: | ||
|
||
``` | ||
ifconfig <if_num> gts | ||
``` | ||
|
||
To switch back to CSMA-CA transmissions, run: | ||
``` | ||
ifconfig <if_num> -gts | ||
``` | ||
5. To transmit data, use the `txtsnd` command: | ||
``` | ||
txtsnd <if_num> <target_L2_address> <message> | ||
``` | ||
In case of GTS transmissions, the MAC will negotiate a slot with the target | ||
device. On success, the message will be transmitted in the next occurrence of | ||
the slot. As a result, the first GTS transmission will take longer than | ||
subsequent transmissions. | ||
Note that GTS expire if not used, which will require a new negotiation. | ||
The expire timeout can be configured with `CONFIG_IEEE802154_DSME_GTS_EXPIRATION` | ||
(by default 16 idle slot occurrences). | ||
|
||
## Static GTS allocation | ||
Although not supported by the standard, openDSME includes a mechanism to override | ||
the dynamic allocation with static allocation. This is useful for experimentation | ||
or quick prototypes. | ||
To enable, compile openDSME with `CONFIG_IEEE802154_DSME_STATIC_GTS=1`. This can | ||
be set via Kconfig or CFLAGS. | ||
|
||
To allocate slots statically, use the `gts` command: | ||
``` | ||
gts <if_num> <neighbour_L2_address> <is_tx> <superframe_id> <slot_id> <channel_id> | ||
``` | ||
|
||
For example, to allocate a pair of slots node 1 (`DE:AD`) and node | ||
B (`BE:EF`), run: | ||
|
||
In node 1 (`DE:AD`) | ||
``` | ||
gts 3 BE:EF 1 0 0 0 | ||
``` | ||
In node 2 (`BE:EF`) | ||
``` | ||
gts 3 DE:AD 0 0 0 0 | ||
``` | ||
|
||
The slot is located in the first slot (0) of the first superframe in the | ||
multisuperframe (0) and uses the first channel (0). Node 1 allocates a TX slot | ||
and node 2 an RX slot. | ||
In contrast to standard GTS, static GTS do not expire. | ||
|
||
To understand more about the superframe structure, check the openDSME | ||
documentation in the RIOT documentation. | ||
|
||
# Port limitations | ||
- So far only GNRC link layer communication is supported (e.g `txtsnd`). | ||
- Only PAN coordinator and child roles are supported. This is not an | ||
openDSME limitation, but rather a missing configuration in the RIOT contrib. | ||
- The current openDSME utilizes heap to allocate internal data structures. | ||
- The scanning/joining procedure is hardcoded to join openDSME beacons. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2021 HAW Hamburg | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* @brief OpenDSME example | ||
* | ||
* @author José I. Álamos <[email protected]> | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
#include "opendsme/opendsme.h" | ||
|
||
#include "net/gnrc.h" | ||
#include "net/gnrc/pktdump.h" | ||
#include "net/gnrc/netreg.h" | ||
|
||
#include "shell.h" | ||
|
||
#define MAIN_QUEUE_SIZE (8) | ||
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; | ||
|
||
int main(void) | ||
{ | ||
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE); | ||
|
||
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, | ||
gnrc_pktdump_pid); | ||
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); | ||
|
||
char line_buf[SHELL_DEFAULT_BUFSIZE]; | ||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2022 HAW Hamburg | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
# | ||
|
||
menuconfig KCONFIG_USEPKG_OPENDSME | ||
bool "Configure openDSME" | ||
help | ||
Configure openDSME using Kconfig. | ||
|
||
if KCONFIG_USEPKG_OPENDSME | ||
|
||
config OPENDSME_MAX_NEIGHBOURS | ||
int "Maximum number of DSME neighbours" | ||
default 20 | ||
|
||
config OPENDSME_MAX_LOST_BEACONS | ||
int "Maximum number of lost beacons before assuming the device desynchronized" | ||
default 8 | ||
help | ||
Sets the maximum number of lost beacons before the MAC triggers a | ||
de-association procedure. Higher values are beneficial in noisy | ||
environments, because the MAC will keep synchronization despite losing some | ||
beacons. However, lower values are better for mobile nodes, because devices | ||
may sinchronize faster to a new coordinator. | ||
|
||
config OPENDSME_CAP_QUEUE_SIZE | ||
int "DSME CAP queue size (for CSMA/CA transmissions)" | ||
default 8 | ||
help | ||
The CAP queue stores frames to be sent during the Contention Access Period | ||
using CSMA-CA. Because the transmission delay of CSMA-CA is lower compared to | ||
GTS transmissions, small values are preferred to reduce memory requirements. | ||
|
||
config OPENDSME_CFP_QUEUE_SIZE | ||
int "DSME CFP queue size (for GTS transmissions)" | ||
default 22 | ||
help | ||
The CFP queue stores frames to be sent during the Contention Free Period | ||
using a dedicated GTS. In contrast to CSMA-CA transmissions, GTS transmission | ||
take longer as a result of slot schedules. Therefore, the GTS queue should | ||
have more capacity than the CAP queue (OPENDSME_CAP_QUEUE_SIZE). | ||
|
||
endif # KCONFIG_USEPKG_OPENDSME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
PKG_NAME=opendsme | ||
PKG_URL=https://github.com/inetrg/openDSME.git | ||
PKG_VERSION=b1969296d0fc9a1556ecbef7c0b01538dff3e10c | ||
PKG_LICENSE=GPL | ||
|
||
include $(RIOTBASE)/pkg/pkg.mk | ||
|
||
OPENDSME_MODULES = \ | ||
opendsme_dsmelayer \ | ||
opendsme_acklayer \ | ||
opendsme_associationmanager \ | ||
opendsme_beaconmanager \ | ||
opendsme_caplayer \ | ||
opendsme_gtsmanager \ | ||
opendsme_messagedispatcher \ | ||
opendsme_messages \ | ||
opendsme_datastructures \ | ||
opendsme_mcps_sap \ | ||
opendsme_mlme_sap \ | ||
opendsme_pib \ | ||
opendsme_adaption_layer \ | ||
opendsme_adaption_layer_scheduling \ | ||
# | ||
|
||
CPPFLAGS += -Wno-deprecated-copy -Wno-unused-parameter -Wno-error | ||
|
||
# dsmeLayer | ||
DIR_DSME_LAYER = dsmeLayer | ||
DIR_opendsme_dsmelayer = $(DIR_DSME_LAYER) | ||
DIR_opendsme_acklayer = $(DIR_DSME_LAYER)/ackLayer | ||
DIR_opendsme_associationmanager = $(DIR_DSME_LAYER)/associationManager | ||
DIR_opendsme_beaconmanager = $(DIR_DSME_LAYER)/beaconManager | ||
DIR_opendsme_caplayer = $(DIR_DSME_LAYER)/capLayer | ||
DIR_opendsme_gtsmanager = $(DIR_DSME_LAYER)/gtsManager | ||
DIR_opendsme_messagedispatcher = $(DIR_DSME_LAYER)/messageDispatcher | ||
DIR_opendsme_messages = $(DIR_DSME_LAYER)/messages | ||
|
||
# MAC Services | ||
|
||
DIR_MAC_SERVICES = mac_services | ||
DIR_opendsme_datastructures = $(DIR_MAC_SERVICES)/dataStructures | ||
DIR_opendsme_mcps_sap = $(DIR_MAC_SERVICES)/mcps_sap | ||
DIR_opendsme_mlme_sap = $(DIR_MAC_SERVICES)/mlme_sap | ||
DIR_opendsme_pib = $(DIR_MAC_SERVICES)/pib | ||
|
||
# DSME Adoption Layer | ||
DIR_DSME_ADAPTION_LAYER = dsmeAdaptionLayer | ||
DIR_opendsme_adaption_layer = $(DIR_DSME_ADAPTION_LAYER) | ||
DIR_opendsme_adaption_layer_scheduling = $(DIR_DSME_ADAPTION_LAYER)/scheduling | ||
|
||
.PHONY: opendsme_% | ||
|
||
export SRCXXEXT=cc | ||
|
||
all: $(OPENDSME_MODULES) | ||
|
||
opendsme_%: | ||
$(QQ)OPENDSME_MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/$(DIR_$@) -f $(CURDIR)/Makefile.opendsme_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FEATURES_REQUIRED += cpp | ||
|
||
# Contrib code of openDSME | ||
USEMODULE += opendsme_riot_contrib | ||
|
||
# Internal openDSME modules | ||
USEMODULE += opendsme_dsmelayer | ||
USEMODULE += opendsme_acklayer | ||
USEMODULE += opendsme_associationmanager | ||
USEMODULE += opendsme_beaconmanager | ||
USEMODULE += opendsme_caplayer | ||
USEMODULE += opendsme_gtsmanager | ||
USEMODULE += opendsme_messagedispatcher | ||
USEMODULE += opendsme_messages | ||
USEMODULE += opendsme_datastructures | ||
USEMODULE += opendsme_mcps_sap | ||
USEMODULE += opendsme_mlme_sap | ||
USEMODULE += opendsme_pib | ||
|
||
# openDSME adaption layer modules | ||
USEMODULE += opendsme_adaption_layer | ||
USEMODULE += opendsme_adaption_layer_scheduling | ||
|
||
# required RIOT modules | ||
USEMODULE += luid | ||
USEMODULE += gnrc | ||
USEMODULE += gnrc_netif | ||
USEMODULE += ieee802154 | ||
USEMODULE += ztimer_usec | ||
|
||
USEMODULE += cpp11-compat | ||
CXXEXFLAGS += -Wno-unused-parameter -Wno-pedantic -Wno-missing-field-initializers -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-unused-variable -Wno-reorder -Wno-address -Wno-sign-compare -Wno-unused-function | ||
FEATURES_REQUIRED += cpp # basic C++ support | ||
FEATURES_REQUIRED += libstdcpp # libstdc++ support (for #include <cstdio>) | ||
|
||
|
||
# Disable Auto-ACK (not supported by openDSME) | ||
CFLAGS += -DCONFIG_IEEE802154_AUTO_ACK_DISABLE=1 | ||
|
||
USEMODULE += random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INCLUDES += -I$(PKGDIRBASE)/opendsme | ||
INCLUDES += -I$(RIOTBASE)/pkg/opendsme/include | ||
|
||
DIRS += $(RIOTBASE)/pkg/opendsme/contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MODULE = $(OPENDSME_MODULE) | ||
|
||
ifeq (opendsme_adaption_layer_scheduling,$(OPENDSME_MODULE)) | ||
# Include TPS and StaticScheduling schedulers | ||
NO_AUTO_SRC := 1 | ||
SRCXX += TPS.cc StaticScheduling.cc | ||
endif | ||
|
||
include $(RIOTBASE)/Makefile.base |
Oops, something went wrong.