Yggdrasil, a C++ Based RTOS for Cortex M3 and M4 - Page 1
Forum section: electronics / general

author: shangaoren
author_rank: Regular Contributor
timestamp: November 26, 2018, 08:11:41 pm
content: Hello everyone,I would like to share with you a project that i’ve been working for couple of month now, this project is an RTOS written in C++ 14 aiming cortex M3, M4 and M7 named Yggdrasil. It was already tested successfully on some cortex M4 from ST Microelectronics (you can take a look at the Bsp repository to see which processors are already running Yggdrasil). Some features are still lacking (like floating point support), this still an in development project but it will be improved over the time.I’m working in small company that makes embedded systems, we are writing all our embedded programs in C++, which allows us to be more flexible and write more reusable software as if it was written in C. As far as I know the C++ is not used a lot in embedded systems, but I think it’s more powerful than C and if it is well written does not have any or not any noticeable overhead. I have seen how C++ RTOS is efficient by using the homemade RTOS we have in my company and as I don’t have found any open source C++ RTOS I decided to write my own.Writing this RTOS allows me to understand more the inner mechanisms of the processor, and I saw that there is not much documentation about how to make an RTOS for Cortex M processors. So I tried to document the code for people who want to understand the code and maybe jump into this adventure and write their own RTOS.I release the project under MIT license, so everyone can use it as is, fork the project to modify it or use it to create your own RTOS.There is already some pages in the wiki that should help if you want to take a look and try it, more articles will come. If you have any question, any remark or any suggestion for new feature, documentation or else, feel free to send me an email via Github, I will answer it as fast as possible.I hope you will enjoy using Yggdrasil as much as i enjoyed coding it =)Yggdrasil :https://github.com/shangaoren/yggdrasil/Bsp for Yggdrasil :https://github.com/shangaoren/bsp

author: krho
author_rank: Regular Contributor
timestamp: November 27, 2018, 05:38:28 am
content: It seems that you have not looked hard enough for c++ RTOS. There is a c++ wrapper for FreeRTOShttps://michaelbecker.github.io/freertos-addons/Then there is aµOS++ IIIefrom Liviu Ionescu the same person that's behind MCU eclipse

author: richardman
author_rank: Frequent Contributor
timestamp: November 27, 2018, 08:06:56 am
content: What RTOS services/functions does this provide? From cursory checking, looks like it only have the basic kernel tasking and IRQ support? Does it provide mutex, semaphore, and Inter Process Communication (IPC) functions?

author: shangaoren
author_rank: Regular Contributor
timestamp: November 27, 2018, 10:04:32 am
content: Quote from: krho on November 27, 2018, 05:38:28 amI didn't see µOS++, i will take a lookQuote from: krho on November 27, 2018, 05:38:28 amFreeRTOS still a C based OS and because of the number of supported MCU there is tons of source code making it difficult to read to my opinion

author: shangaoren
author_rank: Regular Contributor
timestamp: November 27, 2018, 10:07:44 am
content: It provide scheduler, IRQ support and there is Events to ensure IPC communication, i will add mutex and semaphore later, but that's on the road map.Events gives already number of possibilities

author: enz
author_rank: Regular Contributor
timestamp: November 27, 2018, 01:12:30 pm
content: And there is also scmRTOS:https://github.com/scmrtos/scmrtosUsed it successfully in a couple of projects.

author: shangaoren
author_rank: Regular Contributor
timestamp: November 27, 2018, 01:23:00 pm
content: Quote from: enz on November 27, 2018, 01:12:30 pmThis project looks interesting but in order to keep the code light, i'm targeting only cortex M cores. I don't want to target many MCU's but to be efficient and as light as possible on Cortex MBut it seems that there is more RTOS than i found in the past ^^'

author: eugenenine
author_rank: Frequent Contributor
timestamp: November 27, 2018, 01:37:25 pm
content: hmm, any relation to the old Yggdrasil Linux?

author: shangaoren
author_rank: Regular Contributor
timestamp: November 27, 2018, 01:42:26 pm
content: No ^^', i used this name because of nordic mythology, it sounded nice for an OS

author: splin
author_rank: Frequent Contributor
timestamp: November 29, 2018, 11:58:05 pm
content: Perhaps it's a French to English translation issue but in English your *.cpp files should be named *.hpp and vice-versaCall me old fashioned but code should be in *.c* files and definitions in *.h* files.

author: andersm
author_rank: Super Contributor
timestamp: November 30, 2018, 06:37:26 am
content: Quote from: splin on November 29, 2018, 11:58:05 pmIf a template is meant to be instantiated by client code, it must go in a header file. Same for eg. constexpr functions.

author: shangaoren
author_rank: Regular Contributor
timestamp: November 30, 2018, 08:52:54 am
content: Quote from: splin on November 29, 2018, 11:58:05 pmIt's not a translation error, i hope my english is not that bad.The biggest part of the code is in .hpp to give the compiler more possibilities when optimizing