1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Go to file
bors[bot] 7da2817d4c
Merge #20017
20017: tests/core/thread_cooperation: clean up test r=maribu a=maribu

### Contribution description

- add `static` qualifiers where sensible
- drop `volatile` qualifier that was incorrectly used
- add a comment on use of shared memory for inter-thread communication

### Testing procedure

<details><summary><code>make BOARD=nrf52840dk -j -C tests/core/thread_cooperation flash test</code></summary>

```
make: Entering directory '/home/maribu/Repos/software/RIOT/master/tests/core/thread_cooperation'
Building application "tests_thread_cooperation" for "nrf52840dk" with MCU "nrf52".

"make" -C /home/maribu/Repos/software/RIOT/master/pkg/cmsis/ 
"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/nrf52840dk
"make" -C /home/maribu/Repos/software/RIOT/master/core
"make" -C /home/maribu/Repos/software/RIOT/master/core/lib
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/nrf52
"make" -C /home/maribu/Repos/software/RIOT/master/drivers
"make" -C /home/maribu/Repos/software/RIOT/master/sys
"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/nrf52xxxdk
"make" -C /home/maribu/Repos/software/RIOT/master/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/nrf52/periph
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/nrf52/vectors
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/nrf5x_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common/periph
"make" -C /home/maribu/Repos/software/RIOT/master/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/master/sys/div
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/nrf5x_common/periph
"make" -C /home/maribu/Repos/software/RIOT/master/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/master/sys/malloc_thread_safe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/newlib_syscalls_default
"make" -C /home/maribu/Repos/software/RIOT/master/sys/preprocessor
"make" -C /home/maribu/Repos/software/RIOT/master/sys/stdio_uart
"make" -C /home/maribu/Repos/software/RIOT/master/sys/test_utils/interactive_sync
"make" -C /home/maribu/Repos/software/RIOT/master/sys/test_utils/print_stack_usage
"make" -C /home/maribu/Repos/software/RIOT/master/sys/tsrb
   text	  data	   bss	   dec	   hex	filename
  10844	   124	 15004	 25972	  6574	/home/maribu/Repos/software/RIOT/master/tests/core/thread_cooperation/bin/nrf52840dk/tests_thread_cooperation.elf
/home/maribu/Repos/software/RIOT/master/dist/tools/openocd/openocd.sh flash /home/maribu/Repos/software/RIOT/master/tests/core/thread_cooperation/bin/nrf52840dk/tests_thread_cooperation.elf
### Flashing Target ###
Open On-Chip Debugger 0.12.0+dev-snapshot (2023-06-12-09:31)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter serial' not 'jlink serial'
swd
Info : J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 20 2022 16:43:31
Info : Hardware version: 1.00
Info : VTarget = 3.300 V
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [nrf52.cpu] Cortex-M4 r0p1 processor detected
Info : [nrf52.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 0
Info : Listening on port 33571 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* nrf52.cpu          cortex_m   little nrf52.cpu          unknown
[nrf52.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00000838 msp: 0x20000200
Info : nRF52840-xxAA(build code: D0) 1024kB Flash, 256kB RAM
Warn : Adding extra erase range, 0x00002ad8 .. 0x00002fff
auto erase enabled
wrote 10968 bytes from file /home/maribu/Repos/software/RIOT/master/tests/core/thread_cooperation/bin/nrf52840dk/tests_thread_cooperation.elf in 0.710183s (15.082 KiB/s)
verified 10968 bytes in 0.107174s (99.940 KiB/s)
shutdown command invoked
Done flashing
r
/home/maribu/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
READY
s
START
main(): This is RIOT! (Version: 2023.10-devel-433-g647a1)
[START] compute 12! (factorial).
MAIN: create thread, arg: 1
MAIN: msg to T-2
T-02: alive
T-02: got arg 1
MAIN: create thread, arg: 2
MAIN: msg to T-3
T-03: alive
T-03: got arg 2
MAIN: create thread, arg: 3
MAIN: msg to T-4
T-04: alive
T-04: got arg 3
MAIN: create thread, arg: 4
MAIN: msg to T-5
T-05: alive
T-05: got arg 4
MAIN: create thread, arg: 5
MAIN: msg to T-6
T-06: alive
T-06: got arg 5
MAIN: create thread, arg: 6
MAIN: msg to T-7
T-07: alive
T-07: got arg 6
MAIN: create thread, arg: 7
MAIN: msg to T-8
T-08: alive
T-08: got arg 7
MAIN: create thread, arg: 8
MAIN: msg to T-9
T-09: alive
T-09: got arg 8
MAIN: create thread, arg: 9
MAIN: msg to T-10
T-10: alive
T-10: got arg 9
MAIN: create thread, arg: 10
MAIN: msg to T-11
T-11: alive
T-11: got arg 10
MAIN: create thread, arg: 11
MAIN: msg to T-12
T-12: alive
T-12: got arg 11
MAIN: create thread, arg: 12
MAIN: msg to T-13
T-13: alive
T-13: got arg 12
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-2
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-3
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-4
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-5
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-6
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-7
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-8
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-9
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-10
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-11
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-12
{ "threads": [{ "name": "thread", "stack_size": 1024, "stack_used": 388 }]}
MAIN: reply from T-13
MAIN: 12! = 479001600
[SUCCESS]
```

</details>

### Issues/PRs references

None


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-10-26 19:04:38 +00:00
.cargo rust: Update dependencies, use riot-wrappers from git 2023-01-24 20:12:58 +01:00
.github release-test.yml: Fix strasbourg spelling 2023-10-23 11:54:08 +02:00
.vscode .vscode/settings.json: change vertical ruler to comply with coding conventions 2023-10-26 15:27:05 +02:00
boards Merge #19465 #19981 #19995 2023-10-19 19:01:12 +00:00
bootloaders bootloaders/riotboot: fix path to cortexm ldscript test 2023-05-13 19:08:40 +02:00
core Merge #19963 #19971 #19974 #19975 #19976 2023-10-16 15:31:25 +00:00
cpu Merge #19465 #19981 #19995 2023-10-19 19:01:12 +00:00
dist backport_pr.py: increase entries per page for branches GET 2023-10-18 14:12:45 +02:00
doc sys: Add PSA Crypto Module 2023-08-31 14:38:49 +02:00
drivers Merge #19465 #19981 #19995 2023-10-19 19:01:12 +00:00
examples examples/psa_crypto: Update example to work with SEs 2023-10-19 15:31:45 +02:00
fuzzing fuzzing: Add uri_parser fuzzer setup 2022-12-19 13:03:45 +01:00
kconfigs sys/psa_crypto: add support for Ed25519 (EdDSA) 2023-10-09 10:21:44 +02:00
makefiles tree-wide: fix typos in doc and comments 2023-10-16 12:17:48 +02:00
pkg pkg/nanocbor: Update for fixed nanocbor_skip_simple() 2023-10-18 13:40:03 +02:00
sys coap: Set COAP_FORMAT_DNS_MESSAGE to 553 2023-10-25 11:00:56 +02:00
tests tests/core/thread_cooperation: clean up test 2023-10-26 10:34:01 +02:00
.bandit codacy: disable complaining about python assert 2019-03-01 13:43:37 +01:00
.gitattributes rust: Treat Cargo.lock files as opaque 2021-12-14 13:27:42 +01:00
.gitignore .gitignore: ignore all files within .vscode/ except user's settings 2022-11-21 21:30:28 +01:00
.mailmap mailmap: deduplicate @benpicco 2020-04-28 11:58:44 +02:00
.murdock .murdock: re-enable LLVM targets 2023-07-18 12:24:10 +02:00
.murdock.yml CI: use regex for branches in .murdock.yml 2022-12-07 12:53:40 +01:00
bors.toml bors.yaml: re-activate labels check + add block_labels 2023-02-23 15:49:46 +01:00
CITATION.cff CITATION.cff: Initial import 2021-10-22 10:21:57 +02:00
CODE_OF_CONDUCT.md github: add Code of Conduct 2017-12-08 09:10:01 +01:00
CODEOWNERS CODEOWNERS: fix path to test applications 2023-05-13 18:38:31 +02:00
CODING_CONVENTIONS_C++.md CODING_CONVENTIONS_C++.md: Change space after negation 2021-10-28 10:49:51 +02:00
CODING_CONVENTIONS.md tree-wide: fix typos in doc and comments 2023-10-16 12:17:48 +02:00
CONTRIBUTING.md CONTRIBUTING: Remove Freenode reference 2021-06-18 11:11:27 +02:00
doc.txt doc: Link concrete measures from DEVELHELP documentation 2022-01-27 13:49:25 +01:00
Kconfig Kconfig: load application configuration first 2022-04-27 10:31:23 +02:00
LICENSE LICENSE: Fix github badge 2022-08-23 09:46:56 +02:00
LOSTANDFOUND.md LOSTANDFOUND.md: Update with cpu/mips* 2022-09-27 13:43:03 +02:00
MAINTAINING.md MAINTAINING.md: add some notes on Bors 2023-02-27 17:28:16 +01:00
Makefile make: Remove mailing list advertisement 2021-05-12 11:41:25 +02:00
Makefile.base buildsystem/pkg: expand paths early 2022-01-30 19:58:52 +01:00
Makefile.dep cpu/riscv: Add PMP driver 2023-06-28 11:55:34 +02:00
Makefile.features Makefile.features: output board on error 2023-02-27 22:56:34 +01:00
Makefile.include make: COMPILE_COMMANDS_PATH adapt for external apps 2023-08-09 13:20:05 +02:00
README.md README.md: Remove HiL Badge 2023-04-05 11:28:52 +02:00
release-notes.txt tree-wide: fix typos in doc and comments 2023-10-16 12:17:48 +02:00
SECURITY.md SECURITY: Describe that declassification is an option 2023-01-15 16:22:32 +01:00
SUBSYSTEMS.md SUBSYSTEMS.md: add @maribu 2023-06-13 15:03:01 +02:00
uncrustify-riot.cfg uncrustify-riot.cfg: update to coding convention 2021-03-04 17:23:46 +01:00
Vagrantfile tools/packer: adapt for Ubuntu 18.04 2020-02-19 19:23:07 +01:00

Nightly CI status master GitHub release License API docs Wiki Stack Overflow questions Twitter Matrix

The friendly Operating System for IoT!

RIOT is a real-time multi-threading operating system that supports a range of devices that are typically found in the Internet of Things (IoT): 8-bit, 16-bit and 32-bit microcontrollers.

RIOT is based on the following design principles: energy-efficiency, real-time capabilities, small memory footprint, modularity, and uniform API access, independent of the underlying hardware (this API offers partial POSIX compliance).

RIOT is developed by an international open source community which is independent of specific vendors (e.g. similarly to the Linux community). RIOT is licensed with LGPLv2.1, a copyleft license which fosters indirect business models around the free open-source software platform provided by RIOT, e.g. it is possible to link closed-source code with the LGPL code.

FEATURES

RIOT provides features including, but not limited to:

  • a preemptive, tickless scheduler with priorities
  • flexible memory management
  • high resolution, long-term timers
  • MTD abstraction layer
  • File System integration
  • support 200+ boards based on AVR, MSP430, ESP8266, ESP32, RISC-V, ARM7 and ARM Cortex-M
  • the native port allows to run RIOT as-is on Linux and BSD. Multiple instances of RIOT running on a single machine can also be interconnected via a simple virtual Ethernet bridge or via a simulated IEEE 802.15.4 network (ZEP)
  • IPv6
  • 6LoWPAN (RFC4944, RFC6282, and RFC6775)
  • UDP
  • RPL (storing mode, P2P mode)
  • CoAP
  • OTA updates via SUIT
  • MQTT
  • USB (device mode)
  • Display / Touchscreen support
  • CCN-Lite
  • LoRaWAN
  • UWB
  • Bluetooth (BLE) via NimBLE

GETTING RIOT

The most convenient way to get RIOT is to clone it via Git

$ git clone https://github.com/RIOT-OS/RIOT

this will ensure that you get all the newest features and bug fixes with the caveat of an ever changing work environment.

If you prefer things more stable, you can download the source code of one of our quarter annual releases via Github as ZIP file or tarball. You can also checkout a release in a cloned Git repository using

$ git pull --tags
$ git checkout <YYYY.MM>

For more details on our release cycle, check our documentation.

GETTING STARTED

  • You want to start the RIOT? Just follow our quickstart guide or try this tutorial. For specific toolchain installation, follow instructions in the getting started page.
  • The RIOT API itself can be built from the code using doxygen. The latest version of the documentation is uploaded daily to doc.riot-os.org.

FORUM

Do you have a question, want to discuss a new feature, or just want to present your latest project using RIOT? Come over to our forum and post to your hearts content.

CONTRIBUTE

To contribute something to RIOT, please refer to our contributing document.

MAILING LISTS

LICENSE

  • Most of the code developed by the RIOT community is licensed under the GNU Lesser General Public License (LGPL) version 2.1 as published by the Free Software Foundation.
  • Some external sources, especially files developed by SICS are published under a separate license.

All code files contain licensing information.

For more information, see the RIOT website:

https://www.riot-os.org