-
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
examples/dtls-sock: Enable non 32-bit architectures #20196
examples/dtls-sock: Enable non 32-bit architectures #20196
Conversation
Created separate PR (RIOT-OS#20196) This reverts commit 09f4453.
These are all 8-bit boards with enough memory that could be used with the dtls-sock example
|
Does any of it come with a (supported) transceiver? |
At least the This example should be similar to the |
Created separate PR (RIOT-OS#20196) This reverts commit 09f4453.
Created separate PR (RIOT-OS#20196) This reverts commit 09f4453.
Well it always comes down to stack size. With the defaults on
When I bump the stack size it's working:
--- a/examples/dtls-sock/Makefile
+++ b/examples/dtls-sock/Makefile
@@ -49,7 +46,7 @@ CFLAGS += -DDTLS_DEFAULT_PORT=$(DTLS_PORT)
# CFLAGS += -DCONFIG_DTLS_DEBUG
# FIXME: This is a temporary patch
-CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(2*THREAD_STACKSIZE_LARGE\)
+CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(3*THREAD_STACKSIZE_LARGE\)
# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the This is because on AVR With 3072 bytes for
|
Thanks for testing. This explains the Makefile of the dtls-echo example, which contains
Should I just increase the stack size to |
I used this to bump the stack size: From c7c84f8a7d8d08e23895a550470314b1b04969f8 Mon Sep 17 00:00:00 2001
From: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Date: Wed, 27 Dec 2023 21:40:31 +0100
Subject: [PATCH] examples/dtls-sock: Bump stack size even more on AVR
---
examples/dtls-sock/Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/examples/dtls-sock/Makefile b/examples/dtls-sock/Makefile
index 3033e445b6..2337fe6dd2 100644
--- a/examples/dtls-sock/Makefile
+++ b/examples/dtls-sock/Makefile
@@ -45,9 +45,6 @@ CFLAGS += -DDTLS_DEFAULT_PORT=$(DTLS_PORT)
# Uncomment to enable debug logs
# CFLAGS += -DCONFIG_DTLS_DEBUG
-# FIXME: This is a temporary patch
-CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(2*THREAD_STACKSIZE_LARGE\)
-
# 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:
@@ -61,3 +58,10 @@ include $(RIOTBASE)/Makefile.include
# server and client, we need four slots in total. The default (2) would be
# sufficient if only client or server is ever run.
CFLAGS += -DCONFIG_CREDMAN_MAX_CREDENTIALS=4
+
+# FIXME: This is a temporary patch
+ifeq (,$(filter arch_avr8,$(FEATURES_USED)))
+ CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(2*THREAD_STACKSIZE_LARGE\)
+else
+ CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_LARGE\)
+endif
--
2.43.0 Quite interestingly: With my local toolchain, this app goes straight into a bootloop on the ATxmega board. I'm not sure if this is an issue with my toolchain, or our ATxmega part relying on some optimization not being implemented in the GCC version used. It seems this app never supported testing with both DTLS server and client running on the same board, as the credman capacity was too low for this. I was unable to successfully perform a handshake against |
@maribu I've added your patch to the PR. |
Since it worked for @benpicco, that doesn't seem to be an 8-bit compatibility issue. While that issue remains, it is unrelated and should not block the PR. |
Contribution description
Minor change:
Remove the unnecessary
FEATURES_REQUIRED += arch_32bit
filter from the dtls-sock example.(Which the similar dtls-echo example also does not have.)
Testing procedure
Test the dtls-sock example with non 32-bit boards.
DISCLAIMER: I only compiled the example for all boards. I don't have an 8-bit board with enough memory to test this. If someone could test this, I would appreciate it.