Other Parts Discussed in Thread: SYSCONFIG
Hello,
I need some assistance in figuring out the stack memory utilization by FreeRTOS tasks in TMS320F28388D and optimization for the same.
I have configured the FreeRTOS configuration in SysConfig and defined some periodic tasks as mentioned in below table.
Once the project is compiled, I monitored the stack usage of these tasks using Stack Usage View in CCS (ti.com) and during runtime, I printed the stack usage of each tasks using uxTaskGetStackHighWaterMark
Based on these, I had some observations as shown below -
FreeRTOS Tasks |
Task Priority |
Stack memory assigned (Words) |
Stack usage view in CCS (TI) after compiling code (Words) |
Runtime memory (Words) (Without Hardware interrupts) |
Runtime memory (Words) (With Hardware Interrupts) |
Task A |
5 |
512 |
44 |
58 |
186 |
Task B |
5 |
512 |
32 |
58 |
154 |
Task C |
4 |
512 |
24 |
68 |
218 |
Task D |
3 |
512 |
120 |
124 |
316 |
Task E |
2 |
512 |
24 |
68 |
216 |
Task F |
1 |
512 |
26 |
70 |
210 |
Based on the observations, I found out that the stack memory utilization by FreeRTOS tasks is more when hardware interrupts are enabled and it seems that these hardware interrupts is utilizing same FreeRTOS tasks stack memory for context switch/restoring. On investigating further, I found TI FreeRTOS support (Link - TI Free RTOS documentation) and a FreeRTOS form (Link - Porting Problem: System stack vs Task stacks - FreeRTOS) which mentions -
So, I need to understand how c28x FreeRTOS port handles FreeRTOS tasks when hardware interrupts occurs and how the stack memory is utilized. Also, Kindly let me know if the above observations are expected or the stack memory utilization can be further optimized using FreeRTOS configuration.
Thanks!