12

I am new to the RTOS world. I am planning to use some RTOS on a Raspberry Pi 3 (may be FreeRTOS). Can anyone suggest which RTOS would be good for the beginners?

Since they have not released a datasheet on the BCM2837 yet, is it even possible to load RTOS onto a Raspberry Pi 3?

Will this help?

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
sandy
  • 121
  • 1
  • 1
  • 4
  • 1
    There is certainly no reason why you can't load an RTOS onto the RPi. However, requesting a recommendation of a particular OS is off-topic. – Chenmunka May 12 '16 at 12:27
  • 1
    May one know why you need a RTOS? What will it give you that any other OS will not? What are the real-time requirements that you must meet? Could you clarify what makes an RTOS good for beginners? – joan May 12 '16 at 12:43
  • 1
    @Chenmunka "Which is the best RTOS for the RPi?" ("for beginners" or otherwise) would be off-topic as opinion based. This is sort of that, but the title is literally "Does raspberry pi 3 support RTOS?" -> As you point out, presumably yes. If the rest of the question is really taken to mean, what RTOS are there, then it's okay -- which is bound to be the nature of the any actual answer, I would think. There's at least one...sort of. – goldilocks May 12 '16 at 13:04
  • @joan I need RTOS for embedded solutions to automotive applications. Since I am new to RTOS, I was wondering whether it can be leaned with the available hardware (rpi-3) at home. – sandy May 12 '16 at 15:33
  • Take a look at Ultibo core. It may be just what you need. https://ultibo.org – avra May 13 '16 at 19:57

4 Answers4

7

Although the original project only supports Raspberry Pi 1, I have succesfully compiled this fork on a Raspberry Pi 2, and it says to support 3 also.

https://github.com/Forty-Tw0/RaspberryPi-FreeRTOS

jordi
  • 183
  • 1
  • 6
5

Until now I tested the following RTOS without success for raspberry pi 3, that will help someone to not lose time (I wast 3 month) : FreeRTOS, Xenomai, RTEMS, BitThunder, ChibiOS/RT

For RISC OS it is not an a RTOS.

The only one that I was able to run on raspberry pi 3 until now is Fuchsia OS's kernel (Magenta), but it is in a earlier stage and low documented

Another way is to build you RTOS by your self, yes it is possible, using ULTIBO CORE, and following those tutorials: - http://www.valvers.com/open-software/raspberry-pi/step01-bare-metal-programming-in-cpt1/ - https://www.youtube.com/watch?v=TCfpb8M0WeQ

4

ARM, the ISA family used by the Broadcom processors on all current Raspberry Pi models, is based on RISC, for which RISC OS is written. RISC OS I think predominated on ARM devices for their first decade, as the same UK based tech company (Acorn) originally designed both ARM and RISC OS. In fact, ARM initially stood for "Acorn RISC machine", and part of the reason the Raspberry Pi is called what it is is because of a tradition in the UK of naming computer systems after fruits or nuts.

RISC OS is not a true real-time operating system, however, it does use cooperative multi-tasking, meaning you can run a process that can voluntarily refuse to surrender itself to another process. What consequences this may have I don't know, but I would assume that:

  • You can get things configured to allow this without problems, but it may involve restrictions on what the OS can accomplish (e.g., with respect to networking).

  • Context switches to kernel mode will only occur because of system calls made by the process in order to complete its goals.

That's pretty close to real time functionality, depending on how "real time" you need to get. Further, there is some confirmation that RISC OS runs on the Pi 3.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • thanks for the reply. It seems like it is really not needful to use another OS for rpi-3 as the residing OS is also a real time. My application targets to the embedded hardware which cannot have linux based OS like raspbian due to memory constraint. The point is, can I load other RTOS having small memory footprint on rpi-3 just to get used to RTOS world? Are there any limitations on rpi-3? – sandy May 12 '16 at 15:49
  • 1
    I'm sorry: To explain, this is not a discussion forum. Please take the tour again and pay attention to the "Get answers to practical, detailed questions" part. It sounds like you left details out of your question, inviting other people to waste their time providing answers that are not what you were looking for so you could narrow it down afterward discussion style. That is not how SE works. If you have a different question, ask a different question. Do not edit this one to change the original meaning or I will close it. Thank you. – goldilocks May 12 '16 at 16:25
  • 1
    I'll give you a piece of advice though: If you are looking for an OS that will run on systems with sub MB memory, you should find out first what your options are. Just picking a real time OS at random "for practice" may end up teaching you absolutely nothing about the one you end having to really use. So don't waste your time. Find out what you need to use, then ask if you can use it on the pi, etc. – goldilocks May 12 '16 at 16:39
0

Since the definition of an RTOS varies on the application, usually a computer pretending to be something much simpler, RISC OS is an RTOS for the medium-complex applications, and isn't necessarily for high-complex ones, although a highly-complex RTOS sounds like a contradiction in terms. The example by Mahmoud Almostafa RABBAH refers to no OS, and running a single-tasking program straight from the boot-loader, which isn't an RTOS either.

The only way reasonable way of making sense of this is to split the RTOS definition into three levels:

  • Low-complexity would be something like a washing machine or a data logger, and you're probably better off with simpler hardware eg Arduino or maybe a simpler MCU, or even just sequential logic, in the first place. It'll consume less power, and there'd be a lot less to worry about: Never make things more complicated than they have to be.

  • High-complexity would be something like a full multi-tasking system, which a RTOS isn't. It'd probably be better to run your GUI on a separate device, if you want that. High-complexity could also be monitoring processes that call other processes, and some must be prioritised, but again you're better off with some kind of parallel processing there, or it fails the capability of responding in real-time.

  • Medium-complexity would be where you need the interfaces a normal OS can provide, eg USB, and perhaps a small display output, but you want to process a stream of data and not be interrupted by anything. This sounds like the level of an automotive application.

    For that, you could compile something without an OS, using a host machine to develop it, or you could use the version of RISC OS which boots directly into BASIC and develop on the target machine, which is usually easier.

    That will run a single task which can be fast enough to poll for a number of events, without being interrupted by other things. Hardware interrupts would still run unless they're disabled (fairly easy to do), and those are necessary in order to make the display/USB etc work. Other hardware interrupts run timers and IO you may not be using.

Another advantage of RISC OS in RTOS applications, is you can only use the modules you require, something that makes no sense in traditional GUI applications, and had been used by eg STD/AdvantageSix[1] although they use the term "embedded systems" instead of "RTOS". The advantages this brings are simplified design, lower power requirements, lower memory usage, and faster boot times (some I/O device interfaces require mini booting themselves, and the OS has to participate in this, although the timescales are usually too short to notice).

I hope that both fills in some gaps in the info above, and makes clear the gaps in my own knowledge.

[1] http://www.advantagesix.co.uk/about_us.html (Other examples from memory, are no longer available online.)