[riot-notifications] [RIOT-OS/RIOT] boards/z1: tests/rng resets board (#11043)

Gaƫtan Harter notifications at github.com
Fri Feb 22 17:37:59 CET 2019


To be more precise with the stack, I put the `line_buffer` static and defined the stack with its usage:

``` diff
diff --git a/tests/rng/Makefile b/tests/rng/Makefile
index 3c75d2f5e..690dfa74a 100644
--- a/tests/rng/Makefile
+++ b/tests/rng/Makefile
@@ -14,6 +14,9 @@ USEMODULE += xtimer

 FEATURES_OPTIONAL += periph_hwrng

+# Default stack with printf + the tests buffer uint32_t[32]
+CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF+32*sizeof\(uint32_t\)\)
+
 TEST_ON_CI_WHITELIST += native

 include $(RIOTBASE)/Makefile.include
diff --git a/tests/rng/main.c b/tests/rng/main.c
index ff26a95a4..621c618f6 100644
--- a/tests/rng/main.c
+++ b/tests/rng/main.c
@@ -260,7 +260,7 @@ static int cmd_speed(int argc, char **argv)
 int main(void)
 {
     puts("Starting shell...");
-    char line_buf[SHELL_DEFAULT_BUFSIZE];
+    static char line_buf[SHELL_DEFAULT_BUFSIZE];
     shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);

     return 0;
```

When testing with ps enabled:

``` diff
diff --git a/tests/rng/Makefile b/tests/rng/Makefile
index 690dfa74a..c90e0243b 100644
--- a/tests/rng/Makefile
+++ b/tests/rng/Makefile
@@ -10,6 +10,8 @@ BOARD_INSUFFICIENT_MEMORY += arduino-duemilanove arduino-uno
 USEMODULE += fmt
 USEMODULE += random
 USEMODULE += shell
+USEMODULE += shell_commands
+USEMODULE += ps
 USEMODULE += xtimer
 
 FEATURES_OPTIONAL += periph_hwrng
diff --git a/tests/rng/tests/01-run.py b/tests/rng/tests/01-run.py
index e6313058c..3eb78bad9 100755
--- a/tests/rng/tests/01-run.py
+++ b/tests/rng/tests/01-run.py
@@ -12,6 +12,9 @@ from testrunner import run
 
 
 def testfunc(child):
+    child.sendline("ps")
+    child.expect("ps")
+    child.expect("> ")
     # RNG source
     child.sendline("source 0")
     child.sendline("seed 1337")
@@ -64,6 +67,10 @@ def testfunc(child):
     child.sendline("entropy")
     child.expect(re.compile(r"Calculated 0\.017\d{3} bits of entropy from 10000 samples\."))
 
+    child.sendline("ps")
+    child.expect("ps")
+    child.expect("> ")
+
 
 if __name__ == "__main__":
```

I get these ps stack usage outputs after the test so would work for these.

* `wsn430-v1_3b`: `640 (  512)`
* `arduino-mega2560`: `768 (  474)`
* `msba2`: `2688 (  732)`

We see that we may not need the added `32*sizeof(int)` but it would be 100% measured usage on `wsn430-v1_3b` but we could still be going over without being measured.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11043#issuecomment-466460538
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190222/25e852f5/attachment.html>


More information about the notifications mailing list