 Hello, over in this part, we will do some practical example on software timers using CMC's OS version 2. Let's do some practice on software timers. We will start from stm32cubemix or stm32cubedeconfigurator. Important message is that software timers are disabled by default within CMC's OS version 1 and enabled by default within CMC's OS version 2. So in general, to enable software timers, please go to freeR2S configuration, select CMC's OS version 2 and then below within select config parameters, be sure that use timers option is enabled. The next step would be adding some tasks. We will use a single task in this project. Within tasks and cues of freeR2S configuration, please go to task section and press add to add a new task. These task parameters should be the following. Name task1, priority OS priority normal, stack size 256 bytes, entry function name start task1. The rest of the parameters we keep in default state. Our next step would be adding software timer. Within freeR2S configuration, please go to timers and semaphore stub, then click on add button in timers section. Use the following attributes of the new timer. The name, let's keep default default my timer 01, callback, let's keep default as well, callback 01 and type OS timer periodic. Rest of the attributes, please keep in default state and press OK. After this, a new timer should appear within timers section. At the end, we can generate the code and open main C file for further code processing. Let's have a quick look on the code generated by STM32QPIDE or STM32QBMX. We'll focus on main.C file. Within private variables, we can see two handlers. One is a handler to our task1 and the second one is a handler to our software timer. At the beginning of main function, after hardware initialization, we can see a creation of software timer and our task. Then we need to start manually software timer. In our example, we will use task1 function body. So within start task1 function, in its initialization part, we will start our software timer with period 1000 milliseconds using function OS timer start. With an endless loop of task1 function body, please put two operations. Sending task for two seconds into blocked state by function OS delay and execute task action function. In our case, it will be SWO data send. Remaining part of the code of the software timer callback will be covered on next slide. During project creation, we have specified the name of this function, function callback used by the timers as callback 01. Empty callback function is generated by STM32QBMX or STM32QPIDE. We need to fill the code inside this callback. In general, timer callback functions execute in a context of the timer service task. Those callbacks are not called from the interrupt context and should not contain any blocking functions. Structure of those functions is very similar to hooks implementation, described with an advanced topics part of this training. In such a case, we need to put inside the callback function a short action. For this, we will use our task action function with an argument C. So on each call to timer service task, we will see on our ITM single wire viewer monitor a C character. After this code modification, please compile the code, start the debug session, start ITM SWV monitor and run the application. After a run of application, we should see on our SWV ITM data console a similar picture to this one. At the beginning, there is a timer service call task run. So we can see the C letter on the monitor. Then we can see task one action and the character one is displayed. Each two seconds and each one second, we can see an action of software timer again. So the C letter. So we can see the structure like here. So there is C, then after second one, then after second C, then after next second C, after another second is one because there are two seconds between each task one execution. Thank you for watching this video.