download free rtos:
then configure your project file tree:https://www.freertos.org/Documentation/01-FreeRTOS-quick-start/01-Beginners-guide/03-Build-your-first-project
copy it and add it to the stm project and add it the include paths
dont forget to set debug and timebase
freertos provides us with multipule allocation shemas
https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/09-Memory-management/01-Memory-management
<aside> 💡
No assumptions can be made as to where tasks are in their execution with respect to one another – unless they are explicitly synchronized.
</aside>
<aside> 💡
FreeRTOS provides indefinite delays through portMAX_DELAY. When #define INCLUDE_vTaskSuspend 1 is set in FreeRTOSConfig.h, the calling task will be suspended indefinitely, making it safe to ignore the return value of xSemaphoreTake(). Without this definition, portMAX_DELAY will create a very long but finite delay (0xFFFFFFF RTOS ticks, approximately 49.7 days on our system).
</aside>
<aside> 💡
Priority inversion (how not to use semaphores) Semaphores synchronize tasks and protect shared resources, but should we use them to safeguard data shared between two tasks? While each task needs to know when it can safely access the data, there's a significant risk with this approach: semaphores don't consider task priority. A high-priority task waiting for a semaphore held by a low-priority task will be forced to wait, regardless of system conditions or urgency.
</aside>