From 3aa7a1d3526e6a7d86ed09735eb25bb48cdcb44b Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sun, 5 Jan 2014 23:13:01 +0100 Subject: [PATCH 1/3] OP-1152 change stack size to accomodate recent changes in dispatcher, telemetry for former CC (hw rev 1) +review OPReview --- .../boards/coptercontrol/firmware/inc/pios_config.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index a8970239b..6aecae1f9 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -154,11 +154,15 @@ /* Task stack sizes */ #define PIOS_ACTUATOR_STACK_SIZE 1020 -#define PIOS_MANUAL_STACK_SIZE 800 +#define PIOS_MANUAL_STACK_SIZE 850 +#ifdef DIAG_TASKS +#define PIOS_SYSTEM_STACK_SIZE 720 +#else #define PIOS_SYSTEM_STACK_SIZE 660 +#endif #define PIOS_STABILIZATION_STACK_SIZE 524 -#define PIOS_TELEM_STACK_SIZE 800 -#define PIOS_EVENTDISPATCHER_STACK_SIZE 130 +#define PIOS_TELEM_STACK_SIZE 540 +#define PIOS_EVENTDISPATCHER_STACK_SIZE 150 /* This can't be too high to stop eventdispatcher thread overflowing */ #define PIOS_EVENTDISAPTCHER_QUEUE 10 From fff060ed9d16be2014c0fa6c0a1b70665c72ad0d Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sun, 5 Jan 2014 23:28:31 +0100 Subject: [PATCH 2/3] OP-1153 Add a way to monitor SystemMod stack usage without DIAG_TASKS=y SystemStats.SystemModStackRemaining field does contains the relevant information. --- flight/modules/System/systemmod.c | 1 + shared/uavobjectdefinition/systemstats.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/flight/modules/System/systemmod.c b/flight/modules/System/systemmod.c index a16273e2f..d5423e332 100644 --- a/flight/modules/System/systemmod.c +++ b/flight/modules/System/systemmod.c @@ -532,6 +532,7 @@ static void updateStats() // Get Irq stack status stats.IRQStackRemaining = GetFreeIrqStackSize(); + stats.SystemModStackRemaining = uxTaskGetStackHighWaterMark( NULL ) * 4; // When idleCounterClear was not reset by the idle-task, it means the idle-task did not run if (idleCounterClear) { idleCounter = 0; diff --git a/shared/uavobjectdefinition/systemstats.xml b/shared/uavobjectdefinition/systemstats.xml index 4d305a471..52f6c8442 100644 --- a/shared/uavobjectdefinition/systemstats.xml +++ b/shared/uavobjectdefinition/systemstats.xml @@ -4,6 +4,7 @@ + From adde6b2f34fab5a7d610661d778858348505e814 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sun, 5 Jan 2014 23:32:20 +0100 Subject: [PATCH 3/3] OP-1153 Fix for simposix --- flight/modules/System/systemmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flight/modules/System/systemmod.c b/flight/modules/System/systemmod.c index d5423e332..5047e108f 100644 --- a/flight/modules/System/systemmod.c +++ b/flight/modules/System/systemmod.c @@ -524,15 +524,16 @@ static void updateStats() stats.FlightTime = xTaskGetTickCount() * portTICK_RATE_MS; #if defined(ARCH_POSIX) || defined(ARCH_WIN32) // POSIX port of FreeRTOS doesn't have xPortGetFreeHeapSize() + stats.SystemModStackRemaining = 128; stats.HeapRemaining = 10240; #else stats.HeapRemaining = xPortGetFreeHeapSize(); + stats.SystemModStackRemaining = uxTaskGetStackHighWaterMark( NULL ) * 4; #endif // Get Irq stack status stats.IRQStackRemaining = GetFreeIrqStackSize(); - stats.SystemModStackRemaining = uxTaskGetStackHighWaterMark( NULL ) * 4; // When idleCounterClear was not reset by the idle-task, it means the idle-task did not run if (idleCounterClear) { idleCounter = 0;