Skip to content

Commit

Permalink
Use statically allocated stack for the main task
Browse files Browse the repository at this point in the history
Enable FreeRTOS static allocation of tasks and stacks, use it for the main task.
FreeRTOS also requires that idle and timer tasks be statically allocated in that case.

On STM32L4 where data is placed in a separate memory segment this frees up approx 20K of heap.
On other platforms this is neutral in terms of usage but will reduce heap fragmentation a bit.

Does not apply to CC3200 because its FreeRTOS is too old.

CL: Use statically allocated stack for the main task

PUBLISHED_FROM=551879996ca98fbbc0502f1a0462ebbbab597095
  • Loading branch information
Deomid Ryabkov authored and cesantabot committed Oct 27, 2018
1 parent 59c87f8 commit 4c055c1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mos.yml
Expand Up @@ -23,4 +23,21 @@ tags:
- core
- docs:core:Core meta-library

conds:
# FreeRTOS option to enable statically allocated task stacks.
- when: mos.platform == "stm32"
apply:
cdefs:
configSUPPORT_STATIC_ALLOCATION: 1
- when: mos.platform == "cc3220"
apply:
cdefs:
configSUPPORT_STATIC_ALLOCATION: 1
- when: mos.platform == "esp32"
apply:
build_vars:
ESP_IDF_SDKCONFIG_OPTS: >
${build_vars.ESP_IDF_SDKCONFIG_OPTS}
CONFIG_SUPPORT_STATIC_ALLOCATION=1
manifest_version: 2018-06-12

0 comments on commit 4c055c1

Please sign in to comment.