From 9f95ff5b6ba01db09552b84a0ab79607060a2666 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Wed, 11 Dec 2019 08:59:21 +0100 Subject: Official ARM version: v5.4.0 Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3 --- docs/RTOS/html/systemConfig.html | 194 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 docs/RTOS/html/systemConfig.html (limited to 'docs/RTOS/html/systemConfig.html') diff --git a/docs/RTOS/html/systemConfig.html b/docs/RTOS/html/systemConfig.html new file mode 100644 index 0000000..713604a --- /dev/null +++ b/docs/RTOS/html/systemConfig.html @@ -0,0 +1,194 @@ + + + + + +System Configuration +CMSIS-RTOS: System Configuration + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.03 +
+
Real-Time Operating System: API and RTX Reference Implementation.
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
System Configuration
+
+
+

The CMSIS-RTOS RTX provides system-wide settings for:

+ +

+Settings for Round-Robin Thread Switching

+

CMSIS-RTOS RTX may be configured to use round-robin multitasking thread switching. Round-robin allows quasi-parallel execution of several threads of the same priority. Threads are not really executed concurrently, but are scheduled where the available CPU time is divided into time slices and CMSIS-RTOS RTX assigns a time slice to each thread. Because the time slice is typically short (only a few milliseconds), it appears as though threads execute simultaneously.

+

Round-robin thread switching functions as follows:

+
    +
  • the tick is preloaded with the timeout value when a thread switch occurs
  • +
  • the tick is decremented (if not already zero) each system tick if the same thread is still executing
  • +
  • when the tick reaches 0 it indicates that a timeout has occurred. If there is another thread ready with the same priority, then the system switches to that thread and the tick is preloaded with timeout again.
  • +
+

In other words, threads execute for the duration of their time slice (unless a thread's time slice is given up). Then, RTX switches to the next thread that is in READY state and has the same priority. If no other thread with the same priority is ready to run, the current running thread resumes it execution.

+
Note
When switching to higher priority threads, the round-robin timeout value is reset.
+

Round-Robin multitasking is controlled with the #define OS_ROBIN. The time slice period is configured (in RTX Timer ticks) with the #define OS_ROBINTOUT.

+

Code Example:

+

The following example shows a simple CMSIS-RTOS RTX program that uses Round-Robin Multitasking. The two threads in this program are counter loops. RTX starts executing job 1, which is the function named job1. This function creates another task called job2. After job1 executes for its time slice, RTX switches to job2. After job2 executes for its time slice, RTX switches back to job1. This process repeats indefinitely.

+
#include "cmsis_os.h" // CMSIS-RTOS header file
+
+
int counter1;
+
int counter2;
+
+
void job1 (void const *arg) {
+
while (1) { // loop forever
+
counter1++; // update the counter
+
}
+
}
+
+
void job2 (void const *arg) {
+
while (1) { // loop forever
+
counter2++; // update the counter
+
}
+
}
+
+ + +
+
int main (void) {
+
osKernelInitialize (); // setup kernel
+
osThreadCreate (osThread(job1), NULL); // create threads
+
osThreadCreate (osThread(job2), NULL);
+
osKernelStart (); // start kernel
+
}
+
Note
Rather than waiting for a thread time slice to expire, use CMSIS-RTOS functions to signal to the RTX kernel that it can switch to another task. The function osThreadYield passes control to other threads without Round-Robin Multitasking.
+

+User Timer Management

+

CMSIS-RTOS RTX supports Timer Management which provides timer callback functions. The Timer Management is configured with the following #defines:

+ + + + + + + + + + + +
Name #define Description
User Timers OS_TIMERS Enables the Timer Management. When disabled, the osTimerThread is not created.
Timer Thread Priority OS_TIMERPRIO Specifies the priority of the osTimerThread that executes the timer callback functions.
Timer Thread stack size [bytes] OS_TIMERSTKSZ Specifies the stack size (in words) for the the osTimerThread.
Timer Callback Queue size OS_TIMERCBQS Specifies the maximum number of concurrent timer callbacks.
+
Note
Refer to CMSIS-RTOS RTX Threads for more information about the osTimerThread.
+

+ISR FIFO Queue size

+

ISR functions store requests to this buffer, when they are called from the interrupt handler. The default value for #define OS_FIFOSZ is 16.

+
+
+ + + + -- cgit