Lab-Project-FreeRTOS-POSIX icon indicating copy to clipboard operation
Lab-Project-FreeRTOS-POSIX copied to clipboard

Depends on configSUPPORT_STATIC_ALLOCATION

Open asolochek opened this issue 2 years ago • 3 comments

FreeRTOS-Plus-POSIX uses the static versions of semaphore/mutex API functions. These functions only are available if configSUPPORT_STATIC_ALLOCATION is 1. At a minimum this should be listed as a dependency, but ideally this library would work with dynamic allocation as well, as there is a bit of overhead required to use static allocation.

If there is a straightforward way of converting this to use the dynamic versions of the API functions, I'd appreciate learning about that.

asolochek avatar May 09 '23 20:05 asolochek

At a minimum this should be listed as a dependency, but ideally this library would work with dynamic allocation as well, as there is a bit of overhead required to use static allocation.

Agree that it should be listed as a dependency. What do you mean by overhead of using static allocation?

If there is a straightforward way of converting this to use the dynamic versions of the API functions, I'd appreciate learning about that.

It would require you to change the implementation of semaphore and mutex. What is your motivation to do that?

Also, what is your motivation of using these wrappers and not using FreeRTOS native APIs directly?

aggarg avatar May 10 '23 09:05 aggarg

The overhead I'm referring to is needing to implement vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory().

The reason for using posix is because I inherited the project and some components of it run both on the stm32 we are using as well as in some Mac/pc utilities . I guess the previous author thought it would be easier if the threading were portable.

asolochek avatar May 10 '23 14:05 asolochek

You can copy the definitions for these functions from here -

  • https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Demo/app_main.c#L75
  • https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS/Demo/CORTEX_MPU_M7_NUCLEO_H743ZI2_GCC_IAR_Keil/Demo/app_main.c#L100

aggarg avatar May 10 '23 14:05 aggarg