afry-south / dragonfly-fcb

ÅF Dragonfly Quadrotor UAV Project
Other
7 stars 3 forks source link

trim task call stack size #33

Open adam-at-epsilon opened 9 years ago

adam-at-epsilon commented 9 years ago

Task call stack size is supplied as a parameter whenever a task is created.

Giving a too large stack uses up memory unnecessarily. A too small stack size will result in memory being overwritten elsewhere.

adam-at-epsilon commented 8 years ago

define INCLUDE_uxTaskGetStackHighWaterMark

This will enable this: http://www.freertos.org/uxTaskGetStackHighWaterMark.html

Which allows us to see how much of the task stack has been used.

adam-at-epsilon commented 8 years ago

vTaskGetRunTimeStats uses sprintf, not snprintf

adam-at-epsilon commented 8 years ago

with the latest check in task-status prints lowest historical watermarks to console.

Use this to trim stack sizes.

adam-at-epsilon commented 8 years ago

our current stack sizes are, at idle (rightmost numbers, alignment doesn't seem to work ...):

The number meas the lowest number of bytes ever available in the stack so far.

Task             Abs Time    % Time     Stack (rem b)
USB_COM_RX       50215       14%            313
IDLE                      224294     62%         104
FLIGHT_CTRL        66043       18%         88
Tmr Svc            0              <1%           220
tFcbSensors       17677       4%           391
USB_COM_TX        1              <1%          92