Real-Time Interrupt-driven Concurrency (RTIC) framework for ARM Cortex-M microcontrollers
Find a file
bors[bot] aad8f81991
Merge #469
469: Goodbye static mut r=AfoHT a=korken89

Squashed and updated version of @perlindgren branch.

In release there are 0 bytes difference for all examples 🎉 
For debug we see a bloat of ~1-2% worst case, commonly less.

Complete diff of sizes for all examples (first is goodbye static mut, second is master):

```

<   27220	      0	     28	  27248	   6a70	spawn
---
>   27092	      0	     28	  27120	   69f0	spawn

<   16916	      0	     44	  16960	   4240	late
---
>   16836	      0	     44	  16880	   41f0	late

<   15952	      0	     12	  15964	   3e5c	type-usage
---
>   15872	      0	     12	  15884	   3e0c	type-usage

<   22068	      0	     44	  22112	   5660	cfg
---
>   21812	      0	     44	  21856	   5560	cfg

<   34784	      0	     40	  34824	   8808	periodic
---
>   34496	      0	     40	  34536	   86e8	periodic

<   22308	      0	     32	  22340	   5744	task
---
>   21972	      0	     32	  22004	   55f4	task

<   15076	      8	     24	  15108	   3b04	task-local
---
>   14980	      8	     24	  15012	   3aa4	task-local

<   12884	      0	     24	  12908	   326c	destructure
---
>   12820	      0	     24	  12844	   322c	destructure

<   10128	      0	     16	  10144	   27a0	init
---
>   10112	      0	     16	  10128	   2790	init

<   19044	      0	     20	  19064	   4a78	task_named_main
---
>   18916	      0	     20	  18936	   49f8	task_named_main

<   27252	      0	     28	  27280	   6a90	extern_spawn
---
>   27124	      0	     28	  27152	   6a10	extern_spawn

<   10176	      0	     16	  10192	   27d0	idle
---
>   10160	      0	     16	  10176	   27c0	idle

<   13972	      0	     16	  13988	   36a4	resource
---
>   13940	      0	     16	  13956	   3684	resource

<   16228	      0	     24	  16252	   3f7c	multilock
---
>   16116	      0	     24	  16140	   3f0c	multilock

<   14660	      0	     16	  14676	   3954	lock
---
>   14628	      0	     16	  14644	   3934	lock

<   10416	      0	     16	  10432	   28c0	task-local-minimal
---
>   10400	      0	     16	  10416	   28b0	task-local-minimal

<   14164	      0	     24	  14188	   376c	generics
---
>   14148	      0	     24	  14172	   375c	generics

<   30644	      0	     48	  30692	   77e4	message
---
>   30308	      0	     48	  30356	   7694	message

<   28964	      0	     36	  29000	   7148	spawn2
---
>   28724	      0	     36	  28760	   7058	spawn2

<   15952	      0	      8	  15960	   3e58	t-schedule-core-stable
---
>   15872	      0	      8	  15880	   3e08	t-schedule-core-stable

<   17408	      0	     20	  17428	   4414	t-cfg
---
>   17248	      0	     20	  17268	   4374	t-cfg

<   12948	      0	     16	  12964	   32a4	hardware
---
>   12932	      0	     16	  12948	   3294	hardware

<   54640	      0	    104	  54744	   d5d8	t-schedule
---
>   53696	      0	    104	  53800	   d228	t-schedule

<   26132	      0	    548	  26680	   6838	pool
---
>   25876	      0	    548	  26424	   6738	pool

<   22372	      0	     56	  22428	   579c	cfg-whole-task
---
>   22100	      0	     56	  22156	   568c	cfg-whole-task

<   38292	      0	     76	  38368	   95e0	schedule
---
>   37828	      0	     76	  37904	   9410	schedule

<   21216	      0	     32	  21248	   5300	t-spawn
---
>   20880	      0	     32	  20912	   51b0	t-spawn

<   22820	      0	     56	  22876	   595c	capacity
---
>   22580	      0	     56	  22636	   586c	capacity

<   17060	      0	     48	  17108	   42d4	static
---
>   16980	      0	     48	  17028	   4284	static

<   20288	      0	     24	  20312	   4f58	ramfunc
---
>   20096	      0	     24	  20120	   4e98	ramfunc

<   11760	      0	     20	  11780	   2e04	t-resource
---
>   11664	      0	     20	  11684	   2da4	t-resource

<   13028	      0	     16	  13044	   32f4	only-shared-access
---
>   13012	      0	     16	  13028	   32e4	only-shared-access

<   16576	      0	     16	  16592	   40d0	not-sync
---
>   16432	      0	     16	  16448	   4040	not-sync

<   13892	      0	     16	  13908	   3654	resource-user-struct
---
>   13860	      0	     16	  13876	   3634	resource-user-struct

<   37472	      0	     64	  37536	   92a0	double_schedule
---
>   36960	      0	     64	  37024	   90a0	double_schedule

<   17648	      0	      8	  17656	   44f8	t-stask-main
---
>   17520	      0	      8	  17528	   4478	t-stask-main

<    8816	      0	      4	   8820	   2274	t-late-not-send
---
>    8800	      0	      4	   8804	   2264	t-late-not-send

<   23280	      0	     32	  23312	   5b10	types
---
>   23120	      0	     32	  23152	   5a70	types
```

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-22 16:42:45 +00:00
.cargo CI: replace compiletest-rs with trybuild 2019-11-06 19:05:37 -05:00
.github Force push to gh-pages branch 2021-04-13 19:28:55 +02:00
book Merge #479 2021-04-22 13:05:43 +00:00
ci/expected Remove the rest of Travis CI 2020-11-16 22:36:01 +01:00
examples use super::xx now works with monotonics 2021-04-22 17:39:07 +02:00
macros Merge #469 2021-04-22 16:42:45 +00:00
src Goodbye static mut 2021-04-08 19:58:20 +02:00
tests Update the tests file to find the tests 2021-03-03 08:55:23 +01:00
ui Fix the UI tests, remove panic_halt 2021-03-03 09:11:24 +01:00
.gitignore Make identifiers deterministic. 2019-02-16 00:23:01 +01:00
.travis.yml Use travis to set the PATH properly 2020-06-02 20:25:33 +00:00
build.rs Implement all clippy suggestions 2020-10-15 17:09:27 +00:00
Cargo.toml 0.6.0-alpha.2 release 2021-04-08 10:33:40 +02:00
CHANGELOG.md 0.6.0-alpha.2 release 2021-04-08 10:33:40 +02:00
CNAME Rename RTFM to RTIC 2020-06-11 17:18:29 +00:00
CONTRIBUTING.md Rename RTFM to RTIC 2020-06-11 17:18:29 +00:00
LICENSE-APACHE initial commit 2017-03-05 00:29:08 -05:00
LICENSE-CC-BY-SA v0.4.0 2018-11-03 17:16:55 +01:00
LICENSE-MIT Rename RTFM to RTIC 2020-06-11 17:18:29 +00:00
README.md Tiny fix of README-link 2021-04-08 12:19:13 +02:00
README_ru.md update russian translation of the book 2021-04-08 12:22:43 +03:00
redirect.html fix redirects and CNAME 2019-09-15 21:40:40 +02:00

Real-Time Interrupt-driven Concurrency

A concurrency framework for building real-time systems.

Formerly known as Real-Time For the Masses.

crates.io docs.rs book rustc matrix Meeting notes

Features

  • Tasks as the unit of concurrency 1. Tasks can be event triggered (fired in response to asynchronous stimuli) or spawned by the application on demand.

  • Message passing between tasks. Specifically, messages can be passed to software tasks at spawn time.

  • A timer queue 2. Software tasks can be scheduled to run at some time in the future. This feature can be used to implement periodic tasks.

  • Support for prioritization of tasks and, thus, preemptive multitasking.

  • Efficient and data race free memory sharing through fine grained priority based critical sections 1.

  • Deadlock free execution guaranteed at compile time. This is an stronger guarantee than what's provided by the standard Mutex abstraction.

  • Minimal scheduling overhead. The task scheduler has minimal software footprint; the hardware does the bulk of the scheduling.

  • Highly efficient memory usage: All the tasks share a single call stack and there's no hard dependency on a dynamic memory allocator.

  • All Cortex-M devices are fully supported.

  • This task model is amenable to known WCET (Worst Case Execution Time) analysis and scheduling analysis techniques. (Though we haven't yet developed Rust friendly tooling for that.)

Requirements

  • Rust 1.36.0+

  • Applications must be written using the 2018 edition.

User documentation

API reference

Chat

Join us and talk about RTIC in the Matrix room.

Weekly meeting notes can be found over at HackMD

Contributing

New features and big changes should go through the RFC process in the dedicated RFC repository.

Acknowledgments

This crate is based on the Real-Time For the Masses language created by the Embedded Systems group at Luleå University of Technology, led by Prof. Per Lindgren.

References

License

All source code (including code snippets) is licensed under either of

at your option.

The written prose contained within the book is licensed under the terms of the Creative Commons CC-BY-SA v4.0 license (LICENSE-CC-BY-SA or https://creativecommons.org/licenses/by-sa/4.0/legalcode).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.


  1. Eriksson, J., Häggström, F., Aittamaa, S., Kruglyak, A., & Lindgren, P. (2013, June). Real-time for the masses, step 1: Programming API and static priority SRP kernel primitives. In Industrial Embedded Systems (SIES), 2013 8th IEEE International Symposium on (pp. 110-113). IEEE. ↩︎

  2. Lindgren, P., Fresk, E., Lindner, M., Lindner, A., Pereira, D., & Pinho, L. M. (2016). Abstract timers and their implementation onto the arm cortex-m family of mcus. ACM SIGBED Review, 13(1), 48-53. ↩︎