Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Creating a simple CMSIS-RTOS v2 application

Armed with an understanding of the differences between the native FreeRTOS API and the CMSIS-RTOS v2 API, we can develop a bare-bones application with two tasks that blink some LEDs. The goal of this application is to develop code that is only dependent on the CMCSIS-RTOS API rather than the FreeRTOS API. All the code found here resides in main_taskCreation_CMSIS_RTOSV2.c.

This example is similar to those found in Chapter 7The FreeRTOS Scheduler; this one only sets up tasks and blinks LEDs. Follow these steps:

  1. Initialize the RTOS using osStatus_t osKernelInitialize (void), checking the return value before continuing:
osStatus_t status;status = osKernelInitialize();assert(status == osOK);
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content