Hi STACK_MAIN defines the stack size in bytes for your main task. Only if you see low stack warnings on the debug console or in the log, you will need to increase it. Use the top command to see the stack usage of all running applications. COMPILE_FLAGS are additional flags passed to the compiler. You typically don’t need them.
Although I increased the value of STACK_MAIN because ‘low on stack!’ message happens, the stack size is not changed when I see it by the ‘top’ command.
And also I changed all the stack values such as CONFIG_USERMAIN_STACKSIZE in deconfig file, but the stack size of a user made application module does not change.
Finally, the stack size changed after I increased the size in px4_task_spawn_cmd().
Thanks for your feedbacks, I’ve got the same issue. Change STACK_MAIN and STACK_MAX in CMakeLists.txt doesn’t take any effect.
I think because my custom controller (based on mc_att_control) is running on a workqueue (_task_id = task_id_is_work_queue in task_spawn() method). So according to the PX4 documentation (Background Tasks) if I want to run independently from the calling (parent) task, I need to use this px4_task_spawn_cmd() and don’t derive my class from px4::WorkItem class. See navigator_main.cpp as an example.