RTOS Learning Journey:  Project Idea needed - Page 1
Forum section: electronics / general

author: Kittu20
author_rank: Regular Contributor
timestamp: August 08, 2023, 04:53:53 pm
content: Hello everyoneI've been immersing myself in the fascinating realm of Real-Time Operating Systems (RTOS) with a focus on FreeRTOS. The concepts of task scheduling, synchronization, and multitasking have got me intrigued, but now I'm on the hunt for exciting project ideas to put theory into practice.Please keep in mind that I'm looking for projects that are within my reach and not too advanced, so projects like radar systems, air traffic control, and satellites are a bit beyond my current capabilities.Do you have any project suggestions that would be a perfect fit for a RTOS? I’d really appreciate it!

author: shtirka
author_rank: Contributor
timestamp: August 08, 2023, 07:15:31 pm
content: Hello,One project (at least potentially) that you could do is some sort of a medical device or a combination of a health data collection system + smart watch for displaying the health data. The potential problem you have (at least in my personal experience) is that RTOSes in general are seen to have very little actual purpose outside of space, defence, aircraft, medical and vehicle control (everything else can normally be solved without ). So you might be pushed to find an interesting and yet simple real-world RTOS project for learning the RTOS principles.//Ilya

author: tggzzz
author_rank: Super Contributor
timestamp: August 08, 2023, 07:30:16 pm
content: You probably want a simple problem that you can expand and use to explore different RTOS design patterns.Consider a traffic light controller. Start simple, then expand to include traffic sensors, pedestrian request switches, internal logging, remote monitoring and control, etc.Pretend you are caught up in a lawsuit where you are having to prove what happens (and/or happened) and why, and that you have to defend you choices and implementation. Those real world considerations can shape the design patterns you choose and implement.Make sure you understand FSM events and actions, how external sensors cause interrupts that create events. Work out how to guarantee and verify timing by design (not measurement). Avoid multiple priorities; they cause as many problems as they help.

author: DiTBho
author_rank: Super Contributor
timestamp: August 08, 2023, 09:51:15 pm
content: what about a simple MODBUS server able to serve up to n clients?mutex data (kind of central database, on the server)n tasks, one for each client

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 08, 2023, 10:02:57 pm
content: How about starting with reading Hoare's "Communicating Sequential Processes"?

author: tggzzz
author_rank: Super Contributor
timestamp: August 08, 2023, 10:56:02 pm
content: Quote from: SiliconWizard on August 08, 2023, 10:02:57 pmAn excellent ideaSeriously.Then spot the RTOS primitive functions that are useful for implementing a system using CSP design patterns - and use those and no other primitive functions.Avoid using functions related to fiddling around with task scheduling.

author: AVI-crak
author_rank: Regular Contributor
timestamp: August 09, 2023, 01:43:38 am
content: Quote from: Kittu20 on August 08, 2023, 04:53:53 pmThe most simple OShttps://github.com/AVI-crak/Rtos_cortex/tree/master

author: abeyer
author_rank: Frequent Contributor
timestamp: August 09, 2023, 02:36:16 am
content: Quote from: tggzzz on August 08, 2023, 10:56:02 pmThe only downside is you might find yourself yearning for a language that supports the formalism in a first-class way rather than rebuilding it with an ad-hoc subset of other primitives.

author: westfw
author_rank: Super Contributor
timestamp: August 09, 2023, 05:33:59 am
content: QuoteI dunno. Communicating processes are the "interesting" and "difficult" part, but the "useful" part of an RTOS is usually being able to have processes that don't need to communicate (much) with each other.

author: tggzzz
author_rank: Super Contributor
timestamp: August 09, 2023, 08:07:50 am
content: Quote from: abeyer on August 09, 2023, 02:36:16 amYes and no...No: you don't have to yearn - use xC on the XMOS xCORE processors (up to 32 cores) withguaranteedhard realtime behaviour (i.e. not measure and hope you've come across the worst cas behaviour)Yes: even if you have a trad language, "thinking in CSP" is a good way to structure a design and hence structure an implementation using whatever is available.

author: tggzzz
author_rank: Super Contributor
timestamp: August 09, 2023, 08:11:36 am
content: Quote from: westfw on August 09, 2023, 05:33:59 am"Process" in CSP is amuchmore general concept than an RTOS process. It can be a piece of hardware, or a piece of software running without any RTOS, or any combination. As one example, in the xC/xCORE ecosystem, each "process" has its own dedicated core, and the RTOS is implemented in hardware.Having said that, avoiding comms between processesisa good principle -providedit makes the design and implementation simpler and easier to understand and modify.

author: JPortici
author_rank: Super Contributor
timestamp: August 09, 2023, 11:06:34 am
content: if you're looking at freeRTOS specifically, you could just read their book:https://www.freertos.org/Documentation/RTOS_book.html(Mastering the FreeRTOS Real Time Kernel - a Hands On Tutorial Guide)Even if it's written for freeRTOS 9 you can still implement the code examples in the current release. The book is easy to understand at it will also acquaint you with the API and the reference manual

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 09, 2023, 11:59:55 am
content: Nearly any microcontroller project does lots of things "seemingly simultaneous".things like:* Keyboard scanning.* Display output (muliplexing some 7-segment displays is a fun beginners project).* Gathering sensor data, keeping track of limits etc.* Communication with external devices.And for all "simple" applications this is usually done in a master loop combined with neatly placed ISR routines.For small systems an RTOS is not needed.When projects get bigger, quite often an RTOS is still not strictly needed, but it can be nice to add that extra abstraction layer for code readability and re-usablility. Barriers between parts of the software get bigger, and apart from the inherent complexity of the RTOS in itself, this makes software easier to understand, maintain and extend.But keeping motivation is also much easier when you have a project that personally interests you.I think it may be a good idea to search around the net (and/or search directly on gitlab) for a project that interests you, and then re-write that project to work with an RTOS.Also, reading and analyzing code written by others is a separate skill. It's often less fun then writing your own code, but it is a quite essential skill that enables you to stand on the shoulders of all the giants before you. Without that skill you're playing among the insects in the grass. That can be fun too (I remember some book about that). It's just another branch in this Wonderfully Weird World.

author: tggzzz
author_rank: Super Contributor
timestamp: August 09, 2023, 12:02:13 pm
content: Quote from: JPortici on August 09, 2023, 11:06:34 amThat appears to be a tutorial on how to invoke sequences of freeRTOS primitives. That's necessary and useful, but...It does not indicate something I strongly suspect the OP needs: a discussion of the "high level" structure of his application and its use of any RTOS's facilities. Understanding such "Design Patterns" - particularly when and why (and when not) to use individual patterns will greatly benefit the OP.Whether the OP realises that is a separate issue, of course.

author: Kittu20
author_rank: Regular Contributor
timestamp: August 09, 2023, 04:49:39 pm
content: Hey everyone!If you've got hands-on experience with real-time operating systems (RTOS), I'd love to hear about your projects.

author: ralphrmartin
author_rank: Frequent Contributor
timestamp: August 09, 2023, 05:41:55 pm
content: The bookFreeRTOS for ESP32-Arduinois quite an illuminating read with plenty of practical examples if you are getting started.

author: wek
author_rank: Frequent Contributor
timestamp: August 09, 2023, 05:48:50 pm
content: I don't use RTOS, but on general note, I believe in learning through both positive and negative experience.Positive is the straighforward one: write a program which both blinks a LED and transmits anecdotes through an UART.Negative is hard and I don't think there are many helps with that out there. It basically means, how to write a program which does fail, so that I can observe that failure.JW

author: Tation
author_rank: Regular Contributor
timestamp: May 13, 2024, 05:08:38 pm
content: Buy any funny chip (say: a FM receiver, a MP3 decoder,...) and add a keyboard, a display and put that chip to work.

author: tellurium
author_rank: Frequent Contributor
timestamp: May 14, 2024, 07:21:30 am
content: Some RTOS project ideas can be taken from this 2023 thread:https://forums.freertos.org/t/practical-rtos-project-ideas-for-real-world-applications/17981And some more ideas from the 2022 thread:https://www.edaboard.com/threads/rtos-learning.407994/

author: TomS_
author_rank: Frequent Contributor
timestamp: May 16, 2024, 11:58:21 am
content: I used FreeRTOS to implement a battery charger with a twist.It not only turns a charger on and off during daylight hours when the battery needs it, but it also collects some stats that are both displayed on a local LCD and uploaded over LoRaWAN so that I can graph them at home and keep an eye on things remotely (since the charger is in a remote building, and is actually solar powered).There are a few tasks (I think about 13 +/- in total), and a couple of other things like mutexes and queues in use for things like: user interface, ADC readings, relay control, LoRaWAN uplink messages etc.An RTOS probably wasn't strictly necessary to achieve all of this, but it was a fun learning experience and the various features offered by FreeRTOS made some aspects much more trivial to implement I think.

author: JPortici
author_rank: Super Contributor
timestamp: May 16, 2024, 12:50:42 pm
content: Quote from: tellurium on May 14, 2024, 07:21:30 amI see what you did there

author: tggzzz
author_rank: Super Contributor
timestamp: May 16, 2024, 01:12:53 pm
content: Quote from: tellurium on May 14, 2024, 07:21:30 amI hope the OP takes note. I won't hold my breath.

author: TomS_
author_rank: Frequent Contributor
timestamp: May 18, 2024, 12:42:49 am
content: Something in the back of my mind was saying "this name sounds familiar". And there you go.

author: tellurium
author_rank: Frequent Contributor
timestamp: May 18, 2024, 04:42:02 am
content: On topic:The best way to learn something is to implement it yourself.My guess is that most of the forum users at some point attempted to implement an OS.Here is my attempt to create a very basic RTOS - just a simple scheduler, for ARM. About 200 lines of code, two files only - rtos.c and rtos.h, and (I think) easy to understand:https://github.com/cpq/newrtosNo preemption, no message passing/queue API, just a simple round-robin scheduler with 1ms tick.

author: Postal2
author_rank: Frequent Contributor
timestamp: May 18, 2024, 07:23:10 am
content: Quote from: Kittu20 on August 08, 2023, 04:53:53 pmMake electronic access-cards and keys copier. Very simple. Very useful. Helps to avoid criminals to steal your keys when you need copy.

author: radiolistener
author_rank: Super Contributor
timestamp: May 18, 2024, 09:22:36 am
content: You can start with some simple project like temperature/pressure/humidity logger.You can begin with 3 threads:1) Measurement thread requests data from sensors and archive it in some database.2) UI thread implements displaying information and interaction with user through menu3) Communication thread implements communication protocol with PC

author: Kittu20
author_rank: Regular Contributor
timestamp: May 21, 2024, 01:11:14 pm
content: The world's only intelligent person @tellurium , who is so arrogant about his knowledge and enjoys belittling those with less experience. How sad that arrogance is his only companion