pkg/openwsn: re-integrate the network stack as a package #13824
pkg/openwsn: re-integrate the network stack as a package #13824aabadie merged 7 commits intoRIOT-OS:masterfrom
Conversation
|
I realized that |
|
This PR is no longer WIP, but still waiting for some PR's, currently some |
For now I removed this change from this PR, and will tackle that in parallel, the stack still works without crc info, but shows some debug errors when using openvisualizer. The doc has been updated as well.
I'm now using ztimer to addeess this. |
|
@TimothyClaeys might be interested as well. |
aabadie
left a comment
There was a problem hiding this comment.
I found some other minor things in the application README and code.
Otherwise, I was able to make it work on IoT-LAB, between 2 iotlab-m3 as leaves and 1 iotlab-m3 as root. It worked pretty well, not critical errors displayed in openvisualizer, the nodes were able to synchronize and exchange udp packets.
I also noticed that the shell sometimes "eats" some characters.
When the minor things are addressed, I think we can merge this PR. Good job @fjmolinas !
|
@aabadie addressed comments, may I squash? |
|
With the following cleanup in the build system, the build is still working: diff --git a/pkg/openwsn/Makefile b/pkg/openwsn/Makefile
index 0ea448aaac..4680159f02 100644
--- a/pkg/openwsn/Makefile
+++ b/pkg/openwsn/Makefile
@@ -1,4 +1,4 @@
-PKG_NAME=openwsn-fw
+PKG_NAME=openwsn
PKG_URL=https://github.com/openwsn-berkeley/openwsn-fw.git
PKG_VERSION=cbcf622bd9369fcfc8455a5fb9349de2ed3c3a46
PKG_LICENSE=BSD-3-Clause
@@ -19,7 +19,6 @@ OPENWSN_MODULES := $(filter-out $(IGNORE_MODULES),$(filter openwsn_%,$(USEMODULE
.PHONY: openwsn_%
all: $(OPENWSN_MODULES)
- "$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(CURDIR)/Makefile.$(PKG_NAME)
OPENWSN_LOG_LEVEL ?= LOG_NONE
OPENWSN_CFLAGS = -DLOG_LEVEL=$(OPENWSN_LOG_LEVEL)
diff --git a/pkg/openwsn/Makefile.openwsn-fw b/pkg/openwsn/Makefile.openwsn-fw
deleted file mode 100644
index 5e18220f81..0000000000
--- a/pkg/openwsn/Makefile.openwsn-fw
+++ /dev/null
@@ -1,5 +0,0 @@
-MODULE = openwsn
-
-NO_AUTO_SRC = 1
-
-include $(RIOTBASE)/Makefile.base |
|
Here is an improved version of the build system integration: diff --git a/pkg/openwsn/Makefile b/pkg/openwsn/Makefile
index 0ea448aaac..944bf419bd 100644
--- a/pkg/openwsn/Makefile
+++ b/pkg/openwsn/Makefile
@@ -1,4 +1,4 @@
-PKG_NAME=openwsn-fw
+PKG_NAME=openwsn
PKG_URL=https://github.com/openwsn-berkeley/openwsn-fw.git
PKG_VERSION=cbcf622bd9369fcfc8455a5fb9349de2ed3c3a46
PKG_LICENSE=BSD-3-Clause
@@ -18,45 +18,34 @@ OPENWSN_MODULES := $(filter-out $(IGNORE_MODULES),$(filter openwsn_%,$(USEMODULE
.PHONY: openwsn_%
-all: $(OPENWSN_MODULES)
- "$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(CURDIR)/Makefile.$(PKG_NAME)
-
OPENWSN_LOG_LEVEL ?= LOG_NONE
-OPENWSN_CFLAGS = -DLOG_LEVEL=$(OPENWSN_LOG_LEVEL)
-openwsn_%: CFLAGS += $(OPENWSN_CFLAGS)
-
-openwsn_openstack:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_openapps:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openapps -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_drivers:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/drivers/common -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_scheduler:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/kernel/openos -f $(CURDIR)/Makefile.openwsn_module
-openwsn_cjoin:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openapps/cjoin -f $(CURDIR)/Makefile.openwsn_module
+CFLAGS += -Wno-array-bounds
+CFLAGS += -Wno-implicit-fallthrough
+CFLAGS += -Wno-implicit-function-declaration
+CFLAGS += -Wno-incompatible-pointer-types
+CFLAGS += -Wno-maybe-uninitialized
+CFLAGS += -Wno-old-style-definition
+CFLAGS += -Wno-return-type
+CFLAGS += -Wno-sign-compare
+CFLAGS += -Wno-unused-parameter
+CFLAGS += -Wno-strict-prototypes
+CFLAGS += -DLOG_LEVEL=$(OPENWSN_LOG_LEVEL)
+
+OPENWSN_PATH_openstack = openstack
+OPENWSN_PATH_openapps = openapps
+OPENWSN_PATH_drivers = drivers/common
+OPENWSN_PATH_scheduler = kernel/openos
+OPENWSN_PATH_cjoin = openapps/cjoin
+OPENWSN_PATH_opencoap = openapps/opencoap
+OPENWSN_PATH_mac_low = openstack/02a-MAClow
+OPENWSN_PATH_mac_high = openstack/02b-MAChigh
+OPENWSN_PATH_iphc = openstack/03a-IPHC
+OPENWSN_PATH_ipv6 = openstack/03b-IPv6
+OPENWSN_PATH_transport = openstack/04-TRAN
+OPENWSN_PATH_crosslayers = openstack/cross-layers
-openwsn_opencoap:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openapps/opencoap -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_mac_low:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/02a-MAClow -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_mac_high:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/02b-MAChigh -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_iphc:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/03a-IPHC -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_ipv6:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/03b-IPv6 -f $(CURDIR)/Makefile.openwsn_module
-
-openwsn_transport:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/04-TRAN -f $(CURDIR)/Makefile.openwsn_module
+all: $(OPENWSN_MODULES)
-openwsn_crosslayers:
- MODULE=$@ "$(MAKE)" -C $(PKG_SOURCE_DIR)/openstack/cross-layers -f $(CURDIR)/Makefile.openwsn_module
+openwsn_%:
+ "$(MAKE)" -C $(PKG_SOURCE_DIR)/$(OPENWSN_PATH_$*) -f $(RIOTBASE)/Makefile.base MODULE=$@
diff --git a/pkg/openwsn/Makefile.openwsn-fw b/pkg/openwsn/Makefile.openwsn-fw
deleted file mode 100644
index 5e18220f81..0000000000
--- a/pkg/openwsn/Makefile.openwsn-fw
+++ /dev/null
@@ -1,5 +0,0 @@
-MODULE = openwsn
-
-NO_AUTO_SRC = 1
-
-include $(RIOTBASE)/Makefile.base
diff --git a/pkg/openwsn/Makefile.openwsn_module b/pkg/openwsn/Makefile.openwsn_module
deleted file mode 100644
index 66801744d6..0000000000
--- a/pkg/openwsn/Makefile.openwsn_module
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS += -Wno-array-bounds
-CFLAGS += -Wno-implicit-fallthrough
-CFLAGS += -Wno-implicit-function-declaration
-CFLAGS += -Wno-incompatible-pointer-types
-CFLAGS += -Wno-maybe-uninitialized
-CFLAGS += -Wno-old-style-definition
-CFLAGS += -Wno-return-type
-CFLAGS += -Wno-sign-compare
-CFLAGS += -Wno-unused-parameter
-CFLAGS += -Wno-strict-prototypes
-
-include $(RIOTBASE)/Makefile.base |
aabadie
left a comment
There was a problem hiding this comment.
LGTM now. Thanks @fjmolinas for addressing the comments and improving the ifconfig output.
ACK, please squash !
Co-authored-by: Peter Kietzmann <[email protected]> Co-authored-by: Jose Alamos <[email protected]> Co-authored-by: Michel Rottleuthner <[email protected]>
Co-authored-by: Peter Kietzmann <[email protected]>
|
@aabadie There was missing change after your makefile suggestions, they didn't show up initially because the old name for the pkg |
|
GO! |
|
🎉 Now who is making TSCH workable as a |
|
Thanks everyone for all the time spend on reviewing (specially all the annoying typos I kept making) @aabadie @kaspar030 @PeterKietzmann! |
Contribution description
This is meant as a first step in re-intregrating OpenWSN network stack as a pkg to RIOT. It is heavily based on previous work by @PeterKietzmann, @MichelRottleuthner, @jia200x and others in #8570 and its successors.
Its currently tagged as WIP since there are still some cleanups to be done and more testing is needed but it is working on
iotlab-m3,samr21-xpro,iotlab-a8-m3. I currently have some issues withcc2538which is why it hasn't been included in the PR, same goes forat86rf215, but I really want to supportopenmote-bso I hope to get these sorted out for this pr.The goal of this PR is to integrate OpenWSN and all is network security features. Because of the current state of the code, this means including up to the
COAP(+UDP, IPv6, RPL, 6TiSCH). Future work plans on isolating as much as the package as possible alongside the current refactoring that is going on in https://github.com/openwsn-berkeley/openwsn-fw. Please see thepkgdocumentation for more information.This PR does not include the mac isolation work done by @jia200x with OpenWSN. But I'll be happy to include it or work on including it in a follow-up. I tried to layout the makefiles that would allow not including not needed modules in the future, but will probably need some adaptation.
There is currently a verbatim copy of some of
OpenWSNhardware abstraction tests. These still require some cleanup if it makes sense to include them. A tests for theradio abstraction is missing.Implementation Status
Please go through the pkg documentation, but as a summary:
COAP, butCOAPis only needed for joining the network https://datatracker.ietf.org/doc/draft-ietf-6tisch-dtsecurity-zerotouch-join/armboards with a32768HzRTT supporting anat86rf2xxradio.Missing from this PR:
dist/toolsTodo:
sctimerto trigger an ISR immediately we assume thatRTT_IRQis definedand mapped to the matching
IRQn_Type. This is no consistent across allplatforms, not even against all
armplatforms.RTT_FREQUENCYis not configurable for most platforms, implementations shouldbe adapted to make this configurable or their defaults changed to
32Khz.board_info.hto otherRTT_FREQUENCY.Testing
Refer to the main test application documentation in
tests/pkg_openwsn.Otherwise I still need to do more serious testing.
Missing documentatio? Feedback on the approach?
Issues/PRs references
Depends on
#13798#13149Successor of #8570
Related to #12910
Partially addresses #13259