From e803045d1f92081aca555e2c3f147384fda7ec70 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 22 May 2017 13:43:41 -0700 Subject: [PATCH] AP_HAL_Linux: Scheduler: increase stack for scheduler threads RPI-based boards that use RCInput_RPI need more stack space otherwise we end up with stack corruption. This leads to crash particularly when also using GPIO_RPI since it may change what that driver is poking on memory. This increases stack size to 1M which is overkill for most of other boards with a more controllable stack usage. However this exposes that on multiple different HWs a single point for stack size decision may not be the best. This can be improved in future. --- libraries/AP_HAL_Linux/Scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_Linux/Scheduler.cpp b/libraries/AP_HAL_Linux/Scheduler.cpp index 099637a6c7..90ce75861e 100644 --- a/libraries/AP_HAL_Linux/Scheduler.cpp +++ b/libraries/AP_HAL_Linux/Scheduler.cpp @@ -106,7 +106,7 @@ void Scheduler::init() const struct sched_table *t = &sched_table[i]; t->thread->set_rate(t->rate); - t->thread->set_stack_size(256 * 1024); + t->thread->set_stack_size(1024 * 1024); t->thread->start(t->name, t->policy, t->prio); }