Can timer task and idle task use dynamic allocation when configSUPPORT_STATIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION are both set to 1

magicse7en wrote on Thursday, February 28, 2019:

Hello,

If configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION are both set to 1, timer task and idle task will use static allocation.
Can timer task and idle task use dynamic allocation when configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION are both set to 1 ?
Version: FreeRTOS v10.2.0

Thanks!

rtel wrote on Thursday, February 28, 2019:

No. If static allocation is enabled the timer task and idle task must be statically allocated.

magicse7en wrote on Friday, March 01, 2019:

OK, Thanks.

richarddamon wrote on Saturday, March 02, 2019:

Actually, you COULD use dynamic allocation if vApplicationGetIdleTaskMemory() and vApplicationGetTimerTaskMemory() get the memory they return to FreeRTOS from the heap instead of statically allocating it. FreeRTOS would still consider the memory as statically allocated, but as these tasks shouldn’t be deleted the difference doesn’t really matter.

Can’t think of any reason you would want to do that, but you could.