Skip to content

freeman1216/badrtos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BADRTOS

What is this?

A lightweight header-only rtos scheduler for Cortex M4/M33 mcus (in this case STM32F411CE/STM32H562VG) with usual RTOS primitives

Features

  • Priority driven scheduler
  • No isr locks in the kernel
  • MPU support
  • Mutexes, semaphores, message queues
  • Software timers
  • Dynamic memory allocation using buddy allocator and pools
  • Depends only on the linker file and startup code

How to use it

  1. Include the header and dependencies in your project.
  2. Define "BAD_RTOS_IMPLEMENTATION" and include the header
#define BAD_RTOS_IMPLEMENTATION
#include "bad_rtos.h"
  1. Perform your setup in bad_user_setup
void bad_user_setup(){
    bad_task_descr_t task1_descr = {
        .stack = 0,
        .stack_size = TASK1_STACK_SIZE,
        .entry = task1,
        .regions = task1_regions,
        .ticks_to_change = 500,
        .base_priority = TASK2_PRIORITY
    };
    task1h = task_make(&task1_descr);
    bad_task_descr_t task2_descr = {
        .stack = task2_stack,
        .stack_size = TASK2_STACK_SIZE,
        .entry = task2,
        .ticks_to_change = 500,
        .base_priority = TASK2_PRIORITY
    };
    task2h = task_make(&task2_descr);
}```
4. Start the scheduler
```c
bad_rtos_start();

Notes

  • bad_rtos_start() can only be called in the translation unit where implementation was included
  • API is written with static and or zero initilisation in mind, no need to call stuff_init on everything, read the comments for more information

You can freely modify or copy whatever you need.

About

Simple header only RTOS scheduler for arm mcus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages