Setup FreeRTOS and Segger Systemview

2025-07-16 16-17-04.mkv

Setting up rtos

image.png

download free rtos:

Getting started

image.png

Create Task

Notes:

Memory manegement

freertos provides us with multipule allocation shemas

https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/09-Memory-management/01-Memory-management

semaphore

<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.

image.png

</aside>