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

pkg/tinydtls: allow build for AVR #19346

Merged
merged 4 commits into from
Apr 26, 2023
Merged

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 4, 2023

Contribution description

tinyDTLS builds and works just fine on AVR, we only have to disable the custom logging functions as those will try to call printf() with non-literal strings. (We don't even call them, but they get built anyway)

Testing procedure

I used tests/nanocoap_cli for testing. As THREAD_STACKSIZE_DEFAULT is lower on AVR we have to bump the main stack size here:

--- a/tests/nanocoap_cli/Makefile
+++ b/tests/nanocoap_cli/Makefile
@@ -43,7 +43,7 @@ ifeq (,$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
   USEMODULE += shell_cmds_default
 
   # DTLS and VFS operations require more stack on the main thread
-  CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(3*THREAD_STACKSIZE_DEFAULT\)
+  CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(5*THREAD_STACKSIZE_DEFAULT\)
 
   # always enable auto-format for native
   ifeq ($(BOARD),native)

I ran a border router on samr21-xpro with

sudo dist/tools/tapsetup/tapsetup -u eno1
make BOARD=samr21-xpro REUSE_TAP=1 flash term

and examples/gcoap_dtls on native on the tap1 port. I then connected from the avr-rss2 to the native instance via the samr21-xpro border router:

> ncget coaps://[2001:9e8:1400:e100:58b0:8ff:fe67:ad82]/.well-known/core -
2023-03-04 23:06:02,562 # </cli/stats>;ct=0;rt="count";obs,</riot/board>

> ncget coaps://[2001:9e8:1400:e100:58b0:8ff:fe67:ad82]/riot/board -
2023-03-04 23:06:14,386 # netq_node_new: malloc
2023-03-04 23:06:14,390 # cannot add alert, retransmit buffer full
2023-03-04 23:06:14,434 # unexpected ChangeCipherSpec during handshake
2023-03-04 23:06:14,447 # No security context for epoch: 1 (handshake)
2023-03-04 23:06:14,487 # No security context for epoch: 1 (alert)
2023-03-04 23:06:15,981 # No security context for epoch: 1 (handshake)
2023-03-04 23:06:16,411 # netq_node_new: malloc
2023-03-04 23:06:16,416 # cannot add alert, retransmit buffer full
2023-03-04 23:06:16,713 # No security context for epoch: 1 (alert)
2023-03-04 23:06:19,993 # native

Issues/PRs references

upstream PR to no build custom logging functions: eclipse/tinydtls#189

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 4, 2023
@github-actions github-actions bot added the Area: pkg Area: External package ports label Mar 4, 2023
@riot-ci
Copy link

riot-ci commented Mar 4, 2023

Murdock results

✔️ PASSED

824d2f8 tests: update Makefile.ci where tinyDTLS is used

Success Failures Total Runtime
6931 0 6931 10m:34s

Artifacts

@benpicco benpicco added CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 4, 2023
@benpicco benpicco requested a review from maribu March 4, 2023 22:19
@maribu
Copy link
Member

maribu commented Mar 4, 2023

Looks like only some Makefile.ci updstes are needed to get this in

@benpicco
Copy link
Contributor Author

benpicco commented Mar 7, 2023

bors try

bors bot added a commit that referenced this pull request Mar 7, 2023
@bors
Copy link
Contributor

bors bot commented Mar 7, 2023

try

Build failed:

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: examples Area: Example Applications Area: tests Area: tests and testing framework Platform: AVR Platform: This PR/issue effects AVR-based platforms labels Apr 26, 2023
@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Apr 26, 2023

Build succeeded:

@bors bors bot merged commit 429de92 into RIOT-OS:master Apr 26, 2023
@benpicco benpicco deleted the pkg/tinydtls-avr branch April 26, 2023 18:59
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: examples Area: Example Applications Area: pkg Area: External package ports Area: tests Area: tests and testing framework CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants