Skip to content
0:00 / 0:00

#rtos#contextswitch#armcortex-m

#23 RTOS Part-2: Automating the context switch

Quantum Leaps, LLC

74K subscribers • 20 videos on Hallway

YouTube

Intermediate. Assumes working knowledge.

62K views8 years ago2 recommendations

Systems programmingOperating systemsEmbedded systemsConcurrency and parallelism

Miro Samek demonstrates how to automate the context switch process on ARM Cortex-M to build a minimal RTOS kernel.

In this second lesson on RTOS, you will see how to automate the context switch process. Specifically, in this lesson, you will start building your own minimal RTOS that will implement the manual context switch procedure that you worked out in the previous lesson-22. -------- Resources: Find MiROS on GitHub: github.com/QuantumLeaps/MiROS Companion web page for this video course: state-machine.com/quickstart GitHub repository for projects for this video course: github.com/QuantumLeaps/modern-embedded-programming-course Transcript of this lesson: state-machine.com/course/lesson23.txt ARM Community blog post: "Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities": community.arm.com/iot/embedded/b/embedded-blog/posts/cutting… Music credits: The background music comes from: bensound.com/royalty-free-music/track/straight

Why it's here

2 people recommend this

What people say. Highly recommended as an in-depth, hands-on guide to understanding and writing an RTOS scheduler from scratch.

u/active-objectin r/embedded • Recommends

On “Any good RTOS learning material out there?”

There is an in-depth RTOS course on YouTube. This hands-on course is based on the ARM Cortex-M processor and contains 7 videos about 30 minutes each: 1. Part-1: shows how to switch among multiple "superloops" on a single CPU and introduces the concept of the context switch 2. Part-2: shows how to automate the context switch and starts to build a small RTOS kernel 3. Part-3: shows how to automate the scheduling process and adds round-robin scheduling to the the RTOS kernel 4. Part-4: shows how to replace the inefficient busy-waiting (time delay) with efficient \*blocking\* and introduces the concept of thread states and the idle thread 5. Part-5: explains what "real-time" means a…

u/zakkii777in r/embedded • Recommends

On “How does an RTOS start a context switch if only one task is running?”

I would recommend you watch this guy on YouTube: link to this video He writes a ROUND ROBIN scheduler from scratch and he explains all what goes behind the scenes in a very clear and efficient manner

u/minamulhaqin r/embedded • Mentions

Inline Assembly code for arm-none-eabi-gcc compiler I am following RTOS lecture from here [video Here they are using Keil compiler and the syntax is different from gcc because the code is not working for me. The c variable that I want to implement here is Stack pointer defined in struct typedef struct { void *sp; /* stack pointer */ /* ... other attributes associated with a thread */ } OSThread; Here is the function where I want to manipulate the stack pointer. void PendSV_Handler(void) { asm ( "cpsid i\n\t" "ldr r1,%0\n\t" /* "ldr r1,=OS_curr\n\t" */ "ldr r1, r1, #0\n\t" "cbz r1,PendSV_restore\n\t"…