 Hello, in this part we will have a closer look at Thread Flux in practice. Let's test Thread Flux in practice. We can reuse any project from previous labs sessions. We would need one interrupt source, it can be a blue button on Nucleo board connected to PC13 for example. Let's start from configuration within STM32Q Bemix or STM32Q IDE. Within 3RDS configuration, just for the minding, we will use CMCOS version 2, please go to config parameters tab and enable use task notifications. Then again within 3RDS configurations, please go to tasks and Qs tab and create two tasks. Task 1 with start task 1 entry function and task 2 with start task 2 function. P for both should be the same, for example OS priority normal, and the stack size could be the same as well, as an example it can be 256. After this please generate the code and open main.cfile. Inside main.cfile we need to insert an external interrupt callback. Work prototype of this function can be found at the end of HAL GPIO source file. Within this callback we will set flag 1, so this is with 0, within task control block of task 1, and then using task action function we will send an exclamation mark over SWO interface. Next point in our implementation is start task 1 function body. Within its endless loop we will wait for flag mask 1, only with 0 set, with option of clear the flags after and waiting forever as a timeout. For this we will use OS thread flags wait function, while waiting for the flags mask task 1 will be in a blocked state. Once the task will receive its desired flags mask, so after button press in our case it will perform task action by sending 1 over SWO. Here is an example of the final result. Till first press on blue button there is no data communication over SWO interface, so we cannot see anything with a single wire viewer ITM console, as task 1 is a blocked state. Once we press the button we can see an exclamation mark on SWO interface, it is coming from external interrupt callback after flag set operation for task 1. Just after we can see the 1 mark displayed by task 1, after it receives desired flag mask. As we selected clear mask after we need to wait for another mask set. After those 2 signs there is again a silence, no new data within viewer, till next button press and again a pair of exclamation mark and 1 will be displayed. In the next step we will involve task 2, to set different flags mask for task 1. Within start task 2 we will set mask for task 1 to 50 hexadecimal. Then we will send 2 over SWO using task underscore action function. And then we will send task 2 to blocked state for 3 seconds. Within task 1 function, so start task 1 function body, we will change the desired mask from 1 to 51 hexadecimal. An external interrupt callback will remain unchanged. Let's compile our code, start the debug session, open SWO interface and start the application. The beginning on a task 2 has been executed once per 3 seconds, setting 50 hexadecimal flag mask for task 1. Task 1 remains in blocked state as it is waiting for a combination of flags coming from task 2 and an interrupt. Once an interrupt will come, so once we press the blue button, the flag mask from this is ORT with already existing 50 hexadecimal and is giving the desired 51 hexadecimal flags mask. As a result, task 1 is moved from blocked to run state and then it is going to blocked state again as all of the flags has been cleared on exit from this function. In between task 1 is sending 1 over SWO interface just to give the sign of life. After task 1 has been sent to blocked state again waiting for new combination of flags coming from task 2 and interrupt, we need to deliver those 2 flags to unblock it again, so it can be done after next 3 seconds and next button press. Thank you for watching this video.