Author Topic: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4  (Read 2880 times)

0 Members and 1 Guest are viewing this topic.

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« on: November 26, 2018, 08:11:41 pm »
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
 
The following users thanked this post: thm_w, krho, Ash, mars01

Offline krho

  • Regular Contributor
  • *
  • Posts: 223
  • Country: si
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #1 on: November 27, 2018, 05:38:28 am »
It seems that you have not looked hard enough for c++ RTOS. There is a c++ wrapper for FreeRTOS https://michaelbecker.github.io/freertos-addons/

Then there is a µOS++ IIIe from Liviu Ionescu the same person that's behind MCU eclipse
 

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 427
  • Country: us
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #2 on: November 27, 2018, 08:06:56 am »
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?
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
Smart.IO: phone App for embedded systems with no app or wireless coding
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #3 on: November 27, 2018, 10:04:32 am »
Then there is a µOS++ IIIe from Liviu Ionescu the same person that's behind MCU eclipse

I didn't see µOS++, i will take a look

It seems that you have not looked hard enough for c++ RTOS. There is a c++ wrapper for FreeRTOS https://michaelbecker.github.io/freertos-addons/

FreeRTOS 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
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #4 on: November 27, 2018, 10:07:44 am »
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
 

Online enz

  • Regular Contributor
  • *
  • Posts: 134
  • Country: de
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #5 on: November 27, 2018, 01:12:30 pm »
And there is also scmRTOS: https://github.com/scmrtos/scmrtos

Used it successfully in a couple of projects.
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #6 on: November 27, 2018, 01:23:00 pm »
And there is also scmRTOS: https://github.com/scmrtos/scmrtos

Used it successfully in a couple of projects.

This 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 M ;)

But it seems that there is more RTOS than i found in the past ^^'
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #7 on: November 27, 2018, 01:37:25 pm »
hmm, any relation to the old Yggdrasil  Linux?
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #8 on: November 27, 2018, 01:42:26 pm »
No ^^', i used this name because of nordic mythology, it sounded nice for an OS  ^-^
 

Online splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #9 on: November 29, 2018, 11:58:05 pm »
Perhaps it's a French to English translation issue but in English your *.cpp files should be named *.hpp and vice-versa  :popcorn:

Call me old fashioned but code should be in *.c* files and definitions in *.h* files.
 
The following users thanked this post: nctnico

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #10 on: November 30, 2018, 06:37:26 am »
Call me old fashioned but code should be in *.c* files and definitions in *.h* files.
If a template is meant to be instantiated by client code, it must go in a header file. Same for eg. constexpr functions.

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: Yggdrasil, a C++ Based RTOS for Cortex M3 and M4
« Reply #11 on: November 30, 2018, 08:52:54 am »
Perhaps it's a French to English translation issue but in English your *.cpp files should be named *.hpp and vice-versa  :popcorn:

Call me old fashioned but code should be in *.c* files and definitions in *.h* files.

It's not a translation error, i hope my english is not that bad  ;D.
The biggest part of the code is in .hpp to give the compiler more possibilities when optimizing
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf