From 967e4dd127197530aae125cf201af696d2108cc9 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 14 Apr 2016 13:36:36 -0400 Subject: [PATCH] Modified cmake to use STACK_MAX and STACK_MAIN --- cmake/common/px4_base.cmake | 48 +++++++++++++++---- cmake/configs/nuttx_mindpx-v2_default.cmake | 6 ++- .../nuttx_px4-stm32f4discovery_default.cmake | 8 +++- cmake/configs/nuttx_px4fmu-v1_default.cmake | 8 +++- cmake/configs/nuttx_px4fmu-v2_default.cmake | 6 ++- cmake/configs/nuttx_px4fmu-v2_ekf2.cmake | 6 ++- cmake/configs/nuttx_px4fmu-v4_default.cmake | 8 +++- cmake/configs/posix_sitl_default.cmake | 10 ---- cmake/configs/posix_sitl_ekf2.cmake | 10 ---- cmake/configs/posix_sitl_replay.cmake | 10 ---- cmake/nuttx/px4_impl_nuttx.cmake | 12 +---- cmake/qurt/px4_impl_qurt.cmake | 9 +--- src/drivers/ardrone_interface/CMakeLists.txt | 2 +- src/drivers/bst/CMakeLists.txt | 2 +- src/drivers/camera_trigger/CMakeLists.txt | 2 +- src/drivers/ets_airspeed/CMakeLists.txt | 2 +- src/drivers/frsky_telemetry/CMakeLists.txt | 2 +- src/drivers/gimbal/CMakeLists.txt | 1 + src/drivers/gps/CMakeLists.txt | 2 +- src/drivers/hmc5883/CMakeLists.txt | 2 +- src/drivers/l3gd20/CMakeLists.txt | 2 +- src/drivers/lsm303d/CMakeLists.txt | 2 +- src/drivers/meas_airspeed/CMakeLists.txt | 2 +- src/drivers/mpu6000/CMakeLists.txt | 2 +- src/drivers/mpu9250/CMakeLists.txt | 2 +- src/drivers/oreoled/CMakeLists.txt | 1 + src/drivers/pwm_input/CMakeLists.txt | 2 +- src/drivers/pwm_out_sim/CMakeLists.txt | 2 +- src/drivers/px4flow/CMakeLists.txt | 2 +- src/drivers/px4fmu/CMakeLists.txt | 2 +- src/drivers/px4io/CMakeLists.txt | 2 +- src/drivers/trone/CMakeLists.txt | 2 +- src/examples/fixedwing_control/CMakeLists.txt | 6 +-- src/examples/hwtest/CMakeLists.txt | 2 +- src/examples/matlab_csv_serial/CMakeLists.txt | 2 +- src/examples/publisher/CMakeLists.txt | 2 +- src/examples/px4_daemon_app/CMakeLists.txt | 2 +- src/examples/px4_mavlink_debug/CMakeLists.txt | 2 +- src/examples/px4_simple_app/CMakeLists.txt | 2 +- .../rover_steering_control/CMakeLists.txt | 6 +-- src/examples/subscriber/CMakeLists.txt | 2 +- src/lib/tailsitter_recovery/CMakeLists.txt | 1 + src/lib/terrain_estimation/CMakeLists.txt | 1 + .../attitude_estimator_ekf/CMakeLists.txt | 2 +- .../attitude_estimator_q/CMakeLists.txt | 6 +-- src/modules/bottle_drop/CMakeLists.txt | 2 +- src/modules/commander/CMakeLists.txt | 8 +--- src/modules/dataman/CMakeLists.txt | 2 +- src/modules/ekf2/CMakeLists.txt | 9 ++-- src/modules/ekf2_replay/CMakeLists.txt | 9 ++-- .../ekf_att_pos_estimator/CMakeLists.txt | 9 +--- src/modules/fw_att_control/CMakeLists.txt | 2 +- src/modules/fw_pos_control_l1/CMakeLists.txt | 2 +- src/modules/land_detector/CMakeLists.txt | 2 +- .../local_position_estimator/CMakeLists.txt | 15 ++---- src/modules/mavlink/CMakeLists.txt | 7 +-- .../mavlink/mavlink_tests/CMakeLists.txt | 2 +- src/modules/mc_att_control/CMakeLists.txt | 8 ++-- src/modules/mc_pos_control/CMakeLists.txt | 2 +- src/modules/navigator/CMakeLists.txt | 2 +- .../position_estimator_inav/CMakeLists.txt | 10 ++-- src/modules/sdlog2/CMakeLists.txt | 6 +-- src/modules/sensors/CMakeLists.txt | 2 +- src/modules/uORB/CMakeLists.txt | 2 +- src/modules/uavcan/CMakeLists.txt | 4 +- .../posix/drivers/gyrosim/CMakeLists.txt | 2 +- src/systemcmds/bl_update/CMakeLists.txt | 2 +- src/systemcmds/config/CMakeLists.txt | 2 +- src/systemcmds/esc_calib/CMakeLists.txt | 2 +- src/systemcmds/mixer/CMakeLists.txt | 6 +-- src/systemcmds/motor_test/CMakeLists.txt | 2 +- src/systemcmds/nshterm/CMakeLists.txt | 2 +- src/systemcmds/param/CMakeLists.txt | 2 +- src/systemcmds/perf/CMakeLists.txt | 2 +- src/systemcmds/pwm/CMakeLists.txt | 2 +- src/systemcmds/reboot/CMakeLists.txt | 2 +- src/systemcmds/tests/CMakeLists.txt | 2 +- src/systemcmds/top/CMakeLists.txt | 2 +- src/systemcmds/topic_listener/CMakeLists.txt | 2 +- src/systemcmds/ver/CMakeLists.txt | 2 +- 80 files changed, 158 insertions(+), 196 deletions(-) diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake index e2ea80b717..f4caf0c420 100644 --- a/cmake/common/px4_base.cmake +++ b/cmake/common/px4_base.cmake @@ -225,7 +225,9 @@ endfunction() # Usage: # px4_add_module(MODULE # [ MAIN ] -# [ STACK ] +# [ STACK ] !!!!!DEPRECATED, USE STACK_MAIN INSTEAD!!!!!!!!! +# [ STACK_MAIN ] +# [ STACK_MAX ] # [ COMPILE_FLAGS ] # [ INCLUDES ] # [ DEPENDS ] @@ -234,7 +236,9 @@ endfunction() # Input: # MODULE : unique name of module # MAIN : entry point, if not given, assumed to be library -# STACK : size of stack +# STACK : deprecated use stack main instead +# STACK_MAIN : size of stack for main function +# STACK_MAX : maximum stack size of any frame # COMPILE_FLAGS : compile flags # LINK_FLAGS : link flags # SRCS : source files @@ -248,7 +252,7 @@ endfunction() # px4_add_module(MODULE test # SRCS # file.cpp -# STACK 1024 +# STACK_MAIN 1024 # DEPENDS # git_nuttx # ) @@ -257,15 +261,43 @@ function(px4_add_module) px4_parse_function_args( NAME px4_add_module - ONE_VALUE MODULE MAIN STACK PRIORITY + ONE_VALUE MODULE MAIN STACK STACK_MAIN STACK_MAX PRIORITY MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS REQUIRED MODULE ARGN ${ARGN}) add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${SRCS}) + # set defaults if not set + set(MAIN_DEFAULT MAIN-NOTFOUND) + set(STACK_MAIN_DEFAULT 1024) + set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT) + + # default stack max to stack main + if(NOT STACK_MAIN AND STACK) + set(STACK_MAIN ${STACK}) + message(AUTHOR_WARNING "STACK deprecated, USE STACK_MAIN instead!!!!!!!!!!!!") + endif() + + foreach(property MAIN STACK_MAIN PRIORITY) + if(NOT ${property}) + set(${property} ${${property}_DEFAULT}) + endif() + set_target_properties(${MODULE} PROPERTIES ${property} + ${${property}}) + endforeach() + + # default stack max to stack main + if(NOT STACK_MAX) + set(STACK_MAX ${STACK_MAIN}) + endif() + set_target_properties(${MODULE} PROPERTIES STACK_MAX + ${STACK_MAX}) + if(${OS} STREQUAL "qurt" ) set_property(TARGET ${MODULE} PROPERTY POSITION_INDEPENDENT_CODE TRUE) + elseif(${OS} STREQUAL "nuttx" ) + list(APPEND COMPILE_FLAGS -Wframe-larger-than=${STACK_MAX}) endif() if(MAIN) @@ -290,8 +322,8 @@ function(px4_add_module) # store module properties in target # COMPILE_FLAGS and LINK_FLAGS are passed to compiler/linker by cmake - # STACK, MAIN, PRIORITY are PX4 specific - foreach (prop COMPILE_FLAGS LINK_FLAGS STACK MAIN PRIORITY) + # STACK_MAIN, MAIN, PRIORITY are PX4 specific + foreach (prop COMPILE_FLAGS LINK_FLAGS STACK_MAIN MAIN PRIORITY) if (${prop}) set_target_properties(${MODULE} PROPERTIES ${prop} ${${prop}}) endif() @@ -530,10 +562,6 @@ function(px4_add_common_flags) # but generates too many false positives ) - if (${OS} STREQUAL "nuttx") - list(APPEND warnings -Wframe-larger-than=1024) - endif() - if (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*") # QuRT 6.4.X compiler identifies as Clang but does not support this option if (NOT ${OS} STREQUAL "qurt") diff --git a/cmake/configs/nuttx_mindpx-v2_default.cmake b/cmake/configs/nuttx_mindpx-v2_default.cmake index 5e55d7c7a3..e56a3b1674 100644 --- a/cmake/configs/nuttx_mindpx-v2_default.cmake +++ b/cmake/configs/nuttx_mindpx-v2_default.cmake @@ -189,8 +189,10 @@ set(config_io_extra_libs add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" STACK_MAIN "2048") diff --git a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake b/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake index 8815992e40..4d4e705196 100644 --- a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake +++ b/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake @@ -80,8 +80,12 @@ set(config_extra_builtin_cmds add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" + STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" + STACK_MAIN "2048") diff --git a/cmake/configs/nuttx_px4fmu-v1_default.cmake b/cmake/configs/nuttx_px4fmu-v1_default.cmake index 1ed8e7f902..98cab2bf3e 100644 --- a/cmake/configs/nuttx_px4fmu-v1_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v1_default.cmake @@ -171,8 +171,12 @@ set(config_io_extra_libs add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" + STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" + STACK_MAIN "2048") diff --git a/cmake/configs/nuttx_px4fmu-v2_default.cmake b/cmake/configs/nuttx_px4fmu-v2_default.cmake index 80c0038c49..b079322897 100644 --- a/cmake/configs/nuttx_px4fmu-v2_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v2_default.cmake @@ -183,8 +183,10 @@ set(config_io_extra_libs add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" STACK_MAIN "2048") diff --git a/cmake/configs/nuttx_px4fmu-v2_ekf2.cmake b/cmake/configs/nuttx_px4fmu-v2_ekf2.cmake index 5652fed6ac..f24ed6ef29 100644 --- a/cmake/configs/nuttx_px4fmu-v2_ekf2.cmake +++ b/cmake/configs/nuttx_px4fmu-v2_ekf2.cmake @@ -182,8 +182,10 @@ set(config_io_extra_libs add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" STACK_MAIN "2048") diff --git a/cmake/configs/nuttx_px4fmu-v4_default.cmake b/cmake/configs/nuttx_px4fmu-v4_default.cmake index 1b43d1c886..e322dcc0e8 100644 --- a/cmake/configs/nuttx_px4fmu-v4_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v4_default.cmake @@ -179,8 +179,12 @@ set(config_io_extra_libs add_custom_target(sercon) set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "sercon" + STACK_MAIN "2048") add_custom_target(serdis) set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") + PRIORITY "SCHED_PRIORITY_DEFAULT" + MAIN "serdis" + STACK_MAIN "2048") diff --git a/cmake/configs/posix_sitl_default.cmake b/cmake/configs/posix_sitl_default.cmake index 344674aef7..b6863de853 100644 --- a/cmake/configs/posix_sitl_default.cmake +++ b/cmake/configs/posix_sitl_default.cmake @@ -88,13 +88,3 @@ set(config_sitl_debugger ) set_property(CACHE config_sitl_debugger PROPERTY STRINGS "disable;gdb;lldb") - - - -add_custom_target(sercon) -set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") - -add_custom_target(serdis) -set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") diff --git a/cmake/configs/posix_sitl_ekf2.cmake b/cmake/configs/posix_sitl_ekf2.cmake index 20c2d82ff9..a46f8b769c 100644 --- a/cmake/configs/posix_sitl_ekf2.cmake +++ b/cmake/configs/posix_sitl_ekf2.cmake @@ -87,13 +87,3 @@ set(config_sitl_debugger ) set_property(CACHE config_sitl_debugger PROPERTY STRINGS "disable;gdb;lldb") - - - -add_custom_target(sercon) -set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") - -add_custom_target(serdis) -set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") diff --git a/cmake/configs/posix_sitl_replay.cmake b/cmake/configs/posix_sitl_replay.cmake index 6ad18cf8db..6f62cfaeca 100644 --- a/cmake/configs/posix_sitl_replay.cmake +++ b/cmake/configs/posix_sitl_replay.cmake @@ -50,13 +50,3 @@ set(config_sitl_debugger ) set_property(CACHE config_sitl_debugger PROPERTY STRINGS "disable;gdb;lldb") - - - -add_custom_target(sercon) -set_target_properties(sercon PROPERTIES - MAIN "sercon" STACK "2048") - -add_custom_target(serdis) -set_target_properties(serdis PROPERTIES - MAIN "serdis" STACK "2048") diff --git a/cmake/nuttx/px4_impl_nuttx.cmake b/cmake/nuttx/px4_impl_nuttx.cmake index 0af6458e48..e1c7fc3696 100644 --- a/cmake/nuttx/px4_impl_nuttx.cmake +++ b/cmake/nuttx/px4_impl_nuttx.cmake @@ -137,20 +137,12 @@ function(px4_nuttx_generate_builtin_commands) set(builtin_apps_decl_string) set(command_count 0) foreach(module ${MODULE_LIST}) - #message("generating builtin for: ${module}") - # default - set(MAIN_DEFAULT MAIN-NOTFOUND) - set(STACK_DEFAULT 1024) - set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT) - foreach(property MAIN STACK PRIORITY) + foreach(property MAIN STACK_MAIN PRIORITY) get_target_property(${property} ${module} ${property}) - if(NOT ${property}) - set(${property} ${${property}_DEFAULT}) - endif() endforeach() if (MAIN) set(builtin_apps_string - "${builtin_apps_string}\t{\"${MAIN}\", ${PRIORITY}, ${STACK}, ${MAIN}_main},\n") + "${builtin_apps_string}\t{\"${MAIN}\", ${PRIORITY}, ${STACK_MAIN}, ${MAIN}_main},\n") set(builtin_apps_decl_string "${builtin_apps_decl_string}extern int ${MAIN}_main(int argc, char *argv[]);\n") math(EXPR command_count "${command_count}+1") diff --git a/cmake/qurt/px4_impl_qurt.cmake b/cmake/qurt/px4_impl_qurt.cmake index ce229fa87c..1171d7fd6f 100644 --- a/cmake/qurt/px4_impl_qurt.cmake +++ b/cmake/qurt/px4_impl_qurt.cmake @@ -84,15 +84,8 @@ function(px4_qurt_generate_builtin_commands) set(builtin_apps_decl_string) set(command_count 0) foreach(module ${MODULE_LIST}) - # default - set(MAIN_DEFAULT MAIN-NOTFOUND) - set(STACK_DEFAULT 1024) - set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT) - foreach(property MAIN STACK PRIORITY) + foreach(property MAIN STACK_MAIN PRIORITY) get_target_property(${property} ${module} ${property}) - if(NOT ${property}) - set(${property} ${${property}_DEFAULT}) - endif() endforeach() if (MAIN) set(builtin_apps_string diff --git a/src/drivers/ardrone_interface/CMakeLists.txt b/src/drivers/ardrone_interface/CMakeLists.txt index 70f50865ae..ac3de51b65 100644 --- a/src/drivers/ardrone_interface/CMakeLists.txt +++ b/src/drivers/ardrone_interface/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__ardrone_interface MAIN ardrone_interface - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/bst/CMakeLists.txt b/src/drivers/bst/CMakeLists.txt index 7c312fc2e9..f7e5d8ebc3 100644 --- a/src/drivers/bst/CMakeLists.txt +++ b/src/drivers/bst/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__bst MAIN bst - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/camera_trigger/CMakeLists.txt b/src/drivers/camera_trigger/CMakeLists.txt index 18f4bbde36..8674c222d7 100644 --- a/src/drivers/camera_trigger/CMakeLists.txt +++ b/src/drivers/camera_trigger/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__camera_trigger MAIN camera_trigger - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/ets_airspeed/CMakeLists.txt b/src/drivers/ets_airspeed/CMakeLists.txt index f989419311..c89279f26d 100644 --- a/src/drivers/ets_airspeed/CMakeLists.txt +++ b/src/drivers/ets_airspeed/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__ets_airspeed MAIN ets_airspeed - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/frsky_telemetry/CMakeLists.txt b/src/drivers/frsky_telemetry/CMakeLists.txt index a35310aaf7..1273790c88 100644 --- a/src/drivers/frsky_telemetry/CMakeLists.txt +++ b/src/drivers/frsky_telemetry/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__frsky_telemetry MAIN frsky_telemetry - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/gimbal/CMakeLists.txt b/src/drivers/gimbal/CMakeLists.txt index 4a13480cd1..c52d83915f 100644 --- a/src/drivers/gimbal/CMakeLists.txt +++ b/src/drivers/gimbal/CMakeLists.txt @@ -33,6 +33,7 @@ px4_add_module( MODULE drivers__gimbal MAIN gimbal + STACK_MAIN 1024 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/gps/CMakeLists.txt b/src/drivers/gps/CMakeLists.txt index 21849c0aa0..ab2c0f0c70 100644 --- a/src/drivers/gps/CMakeLists.txt +++ b/src/drivers/gps/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__gps MAIN gps - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/hmc5883/CMakeLists.txt b/src/drivers/hmc5883/CMakeLists.txt index 6f2f98a822..63f7cd2862 100644 --- a/src/drivers/hmc5883/CMakeLists.txt +++ b/src/drivers/hmc5883/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__hmc5883 MAIN hmc5883 - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/l3gd20/CMakeLists.txt b/src/drivers/l3gd20/CMakeLists.txt index 4534295694..e02a75e933 100644 --- a/src/drivers/l3gd20/CMakeLists.txt +++ b/src/drivers/l3gd20/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__l3gd20 MAIN l3gd20 - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/lsm303d/CMakeLists.txt b/src/drivers/lsm303d/CMakeLists.txt index c781592137..d2f43526ba 100644 --- a/src/drivers/lsm303d/CMakeLists.txt +++ b/src/drivers/lsm303d/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__lsm303d MAIN lsm303d - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/meas_airspeed/CMakeLists.txt b/src/drivers/meas_airspeed/CMakeLists.txt index 16e0f97b59..fe997e1681 100644 --- a/src/drivers/meas_airspeed/CMakeLists.txt +++ b/src/drivers/meas_airspeed/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__meas_airspeed MAIN meas_airspeed - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/mpu6000/CMakeLists.txt b/src/drivers/mpu6000/CMakeLists.txt index 1a1e7a639e..c4cabd418d 100644 --- a/src/drivers/mpu6000/CMakeLists.txt +++ b/src/drivers/mpu6000/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__mpu6000 MAIN mpu6000 - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/mpu9250/CMakeLists.txt b/src/drivers/mpu9250/CMakeLists.txt index bfbf3f7565..94b1fa3036 100644 --- a/src/drivers/mpu9250/CMakeLists.txt +++ b/src/drivers/mpu9250/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__mpu9250 MAIN mpu9250 - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Weffc++ -Os diff --git a/src/drivers/oreoled/CMakeLists.txt b/src/drivers/oreoled/CMakeLists.txt index f0407c71f6..ea2f774cc8 100644 --- a/src/drivers/oreoled/CMakeLists.txt +++ b/src/drivers/oreoled/CMakeLists.txt @@ -33,6 +33,7 @@ px4_add_module( MODULE drivers__oreoled MAIN oreoled + STACK_MAIN 1024 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/pwm_input/CMakeLists.txt b/src/drivers/pwm_input/CMakeLists.txt index 81c79fd842..9da615d1ee 100644 --- a/src/drivers/pwm_input/CMakeLists.txt +++ b/src/drivers/pwm_input/CMakeLists.txt @@ -33,9 +33,9 @@ px4_add_module( MODULE drivers__pwm_input MAIN pwm_input + STACK_MAIN 1024 COMPILE_FLAGS -Wno-pmf-conversions - SRCS pwm_input.cpp DEPENDS diff --git a/src/drivers/pwm_out_sim/CMakeLists.txt b/src/drivers/pwm_out_sim/CMakeLists.txt index 0febaa0bea..d12a5fdfcf 100644 --- a/src/drivers/pwm_out_sim/CMakeLists.txt +++ b/src/drivers/pwm_out_sim/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__pwm_out_sim MAIN pwm_out_sim - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/px4flow/CMakeLists.txt b/src/drivers/px4flow/CMakeLists.txt index 21bfa4526e..1859ab3534 100644 --- a/src/drivers/px4flow/CMakeLists.txt +++ b/src/drivers/px4flow/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__px4flow MAIN px4flow - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Wno-attributes -Os diff --git a/src/drivers/px4fmu/CMakeLists.txt b/src/drivers/px4fmu/CMakeLists.txt index 492aad5939..768db85d12 100644 --- a/src/drivers/px4fmu/CMakeLists.txt +++ b/src/drivers/px4fmu/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__px4fmu MAIN fmu - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/px4io/CMakeLists.txt b/src/drivers/px4io/CMakeLists.txt index b7250f1145..7280bcd43b 100644 --- a/src/drivers/px4io/CMakeLists.txt +++ b/src/drivers/px4io/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__px4io MAIN px4io - STACK 1800 + STACK_MAIN 1800 COMPILE_FLAGS -Os SRCS diff --git a/src/drivers/trone/CMakeLists.txt b/src/drivers/trone/CMakeLists.txt index e0166dd333..692002abe8 100644 --- a/src/drivers/trone/CMakeLists.txt +++ b/src/drivers/trone/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE drivers__trone MAIN trone - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/examples/fixedwing_control/CMakeLists.txt b/src/examples/fixedwing_control/CMakeLists.txt index e1032db305..bc0e68fbfd 100644 --- a/src/examples/fixedwing_control/CMakeLists.txt +++ b/src/examples/fixedwing_control/CMakeLists.txt @@ -33,10 +33,8 @@ px4_add_module( MODULE examples__fixedwing_control MAIN ex_fixedwing_control - STACK 1200 - COMPILE_FLAGS - -Wframe-larger-than=1300 - + STACK_MAIN 1200 + STACK_MAX 1300 SRCS main.c params.c diff --git a/src/examples/hwtest/CMakeLists.txt b/src/examples/hwtest/CMakeLists.txt index ff256f21be..b4d4d33111 100644 --- a/src/examples/hwtest/CMakeLists.txt +++ b/src/examples/hwtest/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__hwtest MAIN ex_hwtest - STACK 2000 + STACK_MAIN 2000 SRCS hwtest.c DEPENDS diff --git a/src/examples/matlab_csv_serial/CMakeLists.txt b/src/examples/matlab_csv_serial/CMakeLists.txt index 648d03dbbc..43e22d085d 100644 --- a/src/examples/matlab_csv_serial/CMakeLists.txt +++ b/src/examples/matlab_csv_serial/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__matlab_csv_serial MAIN matlab_csv_serial - STACK 2000 + STACK_MAIN 2000 SRCS matlab_csv_serial.c DEPENDS diff --git a/src/examples/publisher/CMakeLists.txt b/src/examples/publisher/CMakeLists.txt index d48aebf6c1..5755a6ff4f 100644 --- a/src/examples/publisher/CMakeLists.txt +++ b/src/examples/publisher/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__publisher MAIN publisher - STACK 1200 + STACK_MAIN 1200 SRCS publisher_main.cpp publisher_start_nuttx.cpp diff --git a/src/examples/px4_daemon_app/CMakeLists.txt b/src/examples/px4_daemon_app/CMakeLists.txt index 2d455353d9..25308396cf 100644 --- a/src/examples/px4_daemon_app/CMakeLists.txt +++ b/src/examples/px4_daemon_app/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__px4_daemon_app MAIN px4_daemon_app - STACK 1200 + STACK_MAIN 1200 SRCS px4_daemon_app.c DEPENDS diff --git a/src/examples/px4_mavlink_debug/CMakeLists.txt b/src/examples/px4_mavlink_debug/CMakeLists.txt index 2f1b5a6a2f..0a030ba21e 100644 --- a/src/examples/px4_mavlink_debug/CMakeLists.txt +++ b/src/examples/px4_mavlink_debug/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__px4_mavlink_debug MAIN px4_mavlink_debug - STACK 2000 + STACK_MAIN 2000 SRCS px4_mavlink_debug.c DEPENDS diff --git a/src/examples/px4_simple_app/CMakeLists.txt b/src/examples/px4_simple_app/CMakeLists.txt index a41f6997b3..c0d22fa8d0 100644 --- a/src/examples/px4_simple_app/CMakeLists.txt +++ b/src/examples/px4_simple_app/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__px4_simple_app MAIN px4_simple_app - STACK 2000 + STACK_MAIN 2000 SRCS px4_simple_app.c DEPENDS diff --git a/src/examples/rover_steering_control/CMakeLists.txt b/src/examples/rover_steering_control/CMakeLists.txt index 0ba4b03f52..5a014b216b 100644 --- a/src/examples/rover_steering_control/CMakeLists.txt +++ b/src/examples/rover_steering_control/CMakeLists.txt @@ -33,10 +33,8 @@ px4_add_module( MODULE examples__rover_steering_control MAIN rover_steering_control - STACK 1200 - COMPILE_FLAGS - -Wframe-larger-than=1300 - + STACK_MAIN 1200 + STACK_MAX 1300 SRCS main.cpp params.c diff --git a/src/examples/subscriber/CMakeLists.txt b/src/examples/subscriber/CMakeLists.txt index 817d309d20..fe72220a43 100644 --- a/src/examples/subscriber/CMakeLists.txt +++ b/src/examples/subscriber/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE examples__subscriber MAIN subscriber - STACK 2400 + STACK_MAIN 2400 SRCS subscriber_main.cpp subscriber_start_nuttx.cpp diff --git a/src/lib/tailsitter_recovery/CMakeLists.txt b/src/lib/tailsitter_recovery/CMakeLists.txt index c7bd713592..7438761b41 100644 --- a/src/lib/tailsitter_recovery/CMakeLists.txt +++ b/src/lib/tailsitter_recovery/CMakeLists.txt @@ -32,6 +32,7 @@ ############################################################################ px4_add_module( MODULE lib__tailsitter_recovery + STACK_MAIN 400 COMPILE_FLAGS -Os SRCS diff --git a/src/lib/terrain_estimation/CMakeLists.txt b/src/lib/terrain_estimation/CMakeLists.txt index 0c1177b96b..ac967fd83b 100644 --- a/src/lib/terrain_estimation/CMakeLists.txt +++ b/src/lib/terrain_estimation/CMakeLists.txt @@ -32,6 +32,7 @@ ############################################################################ px4_add_module( MODULE lib__terrain_estimation + STACK_MAIN 1024 COMPILE_FLAGS -Os SRCS diff --git a/src/modules/attitude_estimator_ekf/CMakeLists.txt b/src/modules/attitude_estimator_ekf/CMakeLists.txt index 8c68904661..7e18a96fc8 100644 --- a/src/modules/attitude_estimator_ekf/CMakeLists.txt +++ b/src/modules/attitude_estimator_ekf/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__attitude_estimator_ekf MAIN attitude_estimator_ekf - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Wno-float-equal SRCS diff --git a/src/modules/attitude_estimator_q/CMakeLists.txt b/src/modules/attitude_estimator_q/CMakeLists.txt index 1a349d5a9d..83f17d3e81 100644 --- a/src/modules/attitude_estimator_q/CMakeLists.txt +++ b/src/modules/attitude_estimator_q/CMakeLists.txt @@ -31,14 +31,12 @@ # ############################################################################# set(MODULE_CFLAGS) -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=1600) -endif() px4_add_module( MODULE modules__attitude_estimator_q MAIN attitude_estimator_q COMPILE_FLAGS ${MODULE_CFLAGS} - STACK 1200 + STACK_MAIN 1200 + STACK_MAX 1600 SRCS attitude_estimator_q_main.cpp DEPENDS diff --git a/src/modules/bottle_drop/CMakeLists.txt b/src/modules/bottle_drop/CMakeLists.txt index 7c77cac340..0d60613c27 100644 --- a/src/modules/bottle_drop/CMakeLists.txt +++ b/src/modules/bottle_drop/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__bottle_drop MAIN bottle_drop - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/modules/commander/CMakeLists.txt b/src/modules/commander/CMakeLists.txt index 4239797e0a..8972791a41 100644 --- a/src/modules/commander/CMakeLists.txt +++ b/src/modules/commander/CMakeLists.txt @@ -30,16 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################ -set(MODULE_CFLAGS -Os) -if(${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=2450) -endif() px4_add_module( MODULE modules__commander MAIN commander - STACK 4096 + STACK_MAIN 4096 + STACK_MAX 2450 COMPILE_FLAGS - ${MODULE_CFLAGS} -Os SRCS commander.cpp diff --git a/src/modules/dataman/CMakeLists.txt b/src/modules/dataman/CMakeLists.txt index b480f3695b..a819bcfedd 100644 --- a/src/modules/dataman/CMakeLists.txt +++ b/src/modules/dataman/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__dataman MAIN dataman - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/modules/ekf2/CMakeLists.txt b/src/modules/ekf2/CMakeLists.txt index 37e4f78d0b..5fae22e36e 100644 --- a/src/modules/ekf2/CMakeLists.txt +++ b/src/modules/ekf2/CMakeLists.txt @@ -30,15 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################# -set(MODULE_CFLAGS) -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=4000) -endif() px4_add_module( MODULE modules__ekf2 MAIN ekf2 - COMPILE_FLAGS ${MODULE_CFLAGS} - STACK 1000 + COMPILE_FLAGS + STACK_MAIN 2500 + STACK_MAX 4000 SRCS ekf2_main.cpp DEPENDS diff --git a/src/modules/ekf2_replay/CMakeLists.txt b/src/modules/ekf2_replay/CMakeLists.txt index ae97e7b7c7..2b7f37466e 100644 --- a/src/modules/ekf2_replay/CMakeLists.txt +++ b/src/modules/ekf2_replay/CMakeLists.txt @@ -30,15 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################# -set(MODULE_CFLAGS) -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=4000) -endif() px4_add_module( MODULE modules__ekf2_replay MAIN ekf2_replay - COMPILE_FLAGS ${MODULE_CFLAGS} - STACK 1000 + COMPILE_FLAGS + STACK_MAIN 1000 + STACK_MAX 4000 SRCS ekf2_replay_main.cpp DEPENDS diff --git a/src/modules/ekf_att_pos_estimator/CMakeLists.txt b/src/modules/ekf_att_pos_estimator/CMakeLists.txt index 13eaeb6d2b..1a24c4805d 100644 --- a/src/modules/ekf_att_pos_estimator/CMakeLists.txt +++ b/src/modules/ekf_att_pos_estimator/CMakeLists.txt @@ -31,16 +31,11 @@ # ############################################################################ -set(MODULE_CFLAGS ) -if(${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=3400) -endif() - px4_add_module( MODULE modules__ekf_att_pos_estimator MAIN ekf_att_pos_estimator - STACK 3000 - COMPILE_FLAGS ${MODULE_CFLAGS} + STACK_MAIN 3000 + STACK_MAX 3400 SRCS ekf_att_pos_estimator_main.cpp estimator_22states.cpp diff --git a/src/modules/fw_att_control/CMakeLists.txt b/src/modules/fw_att_control/CMakeLists.txt index 5d0e6648c2..c29379a4a1 100644 --- a/src/modules/fw_att_control/CMakeLists.txt +++ b/src/modules/fw_att_control/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__fw_att_control MAIN fw_att_control - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/modules/fw_pos_control_l1/CMakeLists.txt b/src/modules/fw_pos_control_l1/CMakeLists.txt index 720d97fac7..ad0626be8d 100644 --- a/src/modules/fw_pos_control_l1/CMakeLists.txt +++ b/src/modules/fw_pos_control_l1/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__fw_pos_control_l1 MAIN fw_pos_control_l1 - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Wno-float-equal -Os diff --git a/src/modules/land_detector/CMakeLists.txt b/src/modules/land_detector/CMakeLists.txt index 9ef684d3b1..f878d485dd 100644 --- a/src/modules/land_detector/CMakeLists.txt +++ b/src/modules/land_detector/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__land_detector MAIN land_detector - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/modules/local_position_estimator/CMakeLists.txt b/src/modules/local_position_estimator/CMakeLists.txt index 1d7152a89c..3702d10aa1 100644 --- a/src/modules/local_position_estimator/CMakeLists.txt +++ b/src/modules/local_position_estimator/CMakeLists.txt @@ -30,21 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################ -if(${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=10000) -elseif(${OS} STREQUAL "posix") - list(APPEND MODULE_CFLAGS -Wno-error) -endif() - -# use custom matrix lib instead of Eigen -add_definitions(-DUSE_MATRIX_LIB) - - px4_add_module( MODULE modules__local_position_estimator MAIN local_position_estimator - STACK 9216 - COMPILE_FLAGS ${MODULE_CFLAGS} + COMPILE_FLAGS -Os + STACK_MAIN 5700 + STACK_MAX 10000 SRCS local_position_estimator_main.cpp BlockLocalPositionEstimator.cpp diff --git a/src/modules/mavlink/CMakeLists.txt b/src/modules/mavlink/CMakeLists.txt index 625c88f9aa..01a8b5fa5c 100644 --- a/src/modules/mavlink/CMakeLists.txt +++ b/src/modules/mavlink/CMakeLists.txt @@ -30,15 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################ -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=1500) -endif() px4_add_module( MODULE modules__mavlink MAIN mavlink - STACK 1200 + STACK_MAIN 1200 + STACK_MAX 1500 COMPILE_FLAGS - ${MODULE_CFLAGS} -Wno-attributes -Wno-packed -DMAVLINK_COMM_NUM_BUFFERS=4 diff --git a/src/modules/mavlink/mavlink_tests/CMakeLists.txt b/src/modules/mavlink/mavlink_tests/CMakeLists.txt index fe902974ee..710f15cd8f 100644 --- a/src/modules/mavlink/mavlink_tests/CMakeLists.txt +++ b/src/modules/mavlink/mavlink_tests/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__mavlink__mavlink_tests MAIN mavlink_tests - STACK 5000 + STACK_MAIN 5000 COMPILE_FLAGS -Weffc++ -DMAVLINK_FTP_UNIT_TEST diff --git a/src/modules/mc_att_control/CMakeLists.txt b/src/modules/mc_att_control/CMakeLists.txt index 6f857624c5..20aec10ac2 100644 --- a/src/modules/mc_att_control/CMakeLists.txt +++ b/src/modules/mc_att_control/CMakeLists.txt @@ -30,14 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################ -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=3500) -endif() px4_add_module( MODULE modules__mc_att_control MAIN mc_att_control - STACK 1200 - COMPILE_FLAGS ${MODULE_CFLAGS} + STACK_MAIN 1200 + STACK_MAX 3500 + COMPILE_FLAGS SRCS mc_att_control_main.cpp DEPENDS diff --git a/src/modules/mc_pos_control/CMakeLists.txt b/src/modules/mc_pos_control/CMakeLists.txt index b501e657d8..5d58414732 100644 --- a/src/modules/mc_pos_control/CMakeLists.txt +++ b/src/modules/mc_pos_control/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__mc_pos_control MAIN mc_pos_control - STACK 1200 + STACK_MAIN 1200 SRCS mc_pos_control_main.cpp DEPENDS diff --git a/src/modules/navigator/CMakeLists.txt b/src/modules/navigator/CMakeLists.txt index 3ab04c2e23..4fb4a5bed4 100644 --- a/src/modules/navigator/CMakeLists.txt +++ b/src/modules/navigator/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE modules__navigator MAIN navigator - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Wno-sign-compare -Os diff --git a/src/modules/position_estimator_inav/CMakeLists.txt b/src/modules/position_estimator_inav/CMakeLists.txt index 2f14727509..518acd712a 100644 --- a/src/modules/position_estimator_inav/CMakeLists.txt +++ b/src/modules/position_estimator_inav/CMakeLists.txt @@ -31,16 +31,12 @@ # ############################################################################ -set(MODULE_CFLAGS ) -if(${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=4000) -endif() - px4_add_module( MODULE modules__position_estimator_inav MAIN position_estimator_inav - STACK 1200 - COMPILE_FLAGS ${MODULE_CFLAGS} + STACK_MAIN 1200 + STACK_MAX 4000 + COMPILE_FLAGS SRCS position_estimator_inav_main.cpp position_estimator_inav_params.cpp diff --git a/src/modules/sdlog2/CMakeLists.txt b/src/modules/sdlog2/CMakeLists.txt index 9d7a1ae8e7..f45e2fd36c 100644 --- a/src/modules/sdlog2/CMakeLists.txt +++ b/src/modules/sdlog2/CMakeLists.txt @@ -30,14 +30,12 @@ # POSSIBILITY OF SUCH DAMAGE. # ############################################################################ -if (${OS} STREQUAL "nuttx") - list(APPEND MODULE_CFLAGS -Wframe-larger-than=1600) -endif() px4_add_module( MODULE modules__sdlog2 MAIN sdlog2 PRIORITY "SCHED_PRIORITY_MAX-30" - STACK 1200 + STACK_MAIN 1200 + STACK_MAX 1600 COMPILE_FLAGS ${MODULE_CFLAGS} -Os diff --git a/src/modules/sensors/CMakeLists.txt b/src/modules/sensors/CMakeLists.txt index 80c59712e1..3361202d0c 100644 --- a/src/modules/sensors/CMakeLists.txt +++ b/src/modules/sensors/CMakeLists.txt @@ -43,7 +43,7 @@ px4_add_module( MODULE modules__sensors MAIN sensors PRIORITY "SCHED_PRIORITY_MAX-5" - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Wno-type-limits -O3 diff --git a/src/modules/uORB/CMakeLists.txt b/src/modules/uORB/CMakeLists.txt index 840b1307ae..bb6872d487 100644 --- a/src/modules/uORB/CMakeLists.txt +++ b/src/modules/uORB/CMakeLists.txt @@ -73,7 +73,7 @@ endif() px4_add_module( MODULE modules__uORB MAIN uorb - STACK 2048 + STACK_MAIN 2048 COMPILE_FLAGS -Os SRCS ${SRCS} diff --git a/src/modules/uavcan/CMakeLists.txt b/src/modules/uavcan/CMakeLists.txt index 36220bb0c3..72dac21b08 100644 --- a/src/modules/uavcan/CMakeLists.txt +++ b/src/modules/uavcan/CMakeLists.txt @@ -56,9 +56,9 @@ include_directories(libuavcan/libuavcan_drivers/stm32/driver/include) px4_add_module( MODULE modules__uavcan MAIN uavcan - STACK 3200 + STACK_MAIN 3200 + STACK_MAX 1500 COMPILE_FLAGS - -Wframe-larger-than=1500 -Wno-deprecated-declarations -Os SRCS diff --git a/src/platforms/posix/drivers/gyrosim/CMakeLists.txt b/src/platforms/posix/drivers/gyrosim/CMakeLists.txt index a1b42bd11c..bac977afbb 100644 --- a/src/platforms/posix/drivers/gyrosim/CMakeLists.txt +++ b/src/platforms/posix/drivers/gyrosim/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE platforms__posix__drivers__gyrosim MAIN gyrosim - STACK 1200 + STACK_MAIN 1200 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/bl_update/CMakeLists.txt b/src/systemcmds/bl_update/CMakeLists.txt index 5b9d7953e5..e740def3f7 100644 --- a/src/systemcmds/bl_update/CMakeLists.txt +++ b/src/systemcmds/bl_update/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__bl_update MAIN bl_update - STACK 4096 + STACK_MAIN 4096 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/config/CMakeLists.txt b/src/systemcmds/config/CMakeLists.txt index c2e876ff28..98728311a7 100644 --- a/src/systemcmds/config/CMakeLists.txt +++ b/src/systemcmds/config/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__config MAIN config - STACK 4096 + STACK_MAIN 4096 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/esc_calib/CMakeLists.txt b/src/systemcmds/esc_calib/CMakeLists.txt index 229271b1d8..efe5a0be33 100644 --- a/src/systemcmds/esc_calib/CMakeLists.txt +++ b/src/systemcmds/esc_calib/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__esc_calib MAIN esc_calib - STACK 4096 + STACK_MAIN 4096 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/mixer/CMakeLists.txt b/src/systemcmds/mixer/CMakeLists.txt index 117f96ff2a..6007238e4c 100644 --- a/src/systemcmds/mixer/CMakeLists.txt +++ b/src/systemcmds/mixer/CMakeLists.txt @@ -31,14 +31,12 @@ # ############################################################################ set(MIXER_CFLAGS -Os) -if(${OS} STREQUAL "nuttx") - list(APPEND MIXER_CFLAGS -Wframe-larger-than=2100) -endif() px4_add_module( MODULE systemcmds__mixer MAIN mixer - STACK 4096 + STACK_MAIN 4096 + STACK_MAX 2100 COMPILE_FLAGS ${MIXER_CFLAGS} SRCS mixer.cpp diff --git a/src/systemcmds/motor_test/CMakeLists.txt b/src/systemcmds/motor_test/CMakeLists.txt index 77e9905178..0eda57e550 100644 --- a/src/systemcmds/motor_test/CMakeLists.txt +++ b/src/systemcmds/motor_test/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__motor_test MAIN motor_test - STACK 4096 + STACK_MAIN 4096 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/nshterm/CMakeLists.txt b/src/systemcmds/nshterm/CMakeLists.txt index 30c2e58a51..8cd8574295 100644 --- a/src/systemcmds/nshterm/CMakeLists.txt +++ b/src/systemcmds/nshterm/CMakeLists.txt @@ -34,7 +34,7 @@ px4_add_module( MODULE systemcmds__nshterm MAIN nshterm PRIORITY "SCHED_PRIORITY_DEFAULT-30" - STACK 1500 + STACK_MAIN 1500 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/param/CMakeLists.txt b/src/systemcmds/param/CMakeLists.txt index 8158bfb09e..951f8e957d 100644 --- a/src/systemcmds/param/CMakeLists.txt +++ b/src/systemcmds/param/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__param MAIN param - STACK 2500 + STACK_MAIN 2500 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/perf/CMakeLists.txt b/src/systemcmds/perf/CMakeLists.txt index 8a0a3a815c..fbe202cea1 100644 --- a/src/systemcmds/perf/CMakeLists.txt +++ b/src/systemcmds/perf/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__perf MAIN perf - STACK 1800 + STACK_MAIN 1800 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/pwm/CMakeLists.txt b/src/systemcmds/pwm/CMakeLists.txt index 5a632e669e..c18cbb505c 100644 --- a/src/systemcmds/pwm/CMakeLists.txt +++ b/src/systemcmds/pwm/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__pwm MAIN pwm - STACK 2400 + STACK_MAIN 2400 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/reboot/CMakeLists.txt b/src/systemcmds/reboot/CMakeLists.txt index 635b88b95d..fea17a74c8 100644 --- a/src/systemcmds/reboot/CMakeLists.txt +++ b/src/systemcmds/reboot/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__reboot MAIN reboot - STACK 800 + STACK_MAIN 800 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/tests/CMakeLists.txt b/src/systemcmds/tests/CMakeLists.txt index 8fc1ea5451..460c46ac73 100644 --- a/src/systemcmds/tests/CMakeLists.txt +++ b/src/systemcmds/tests/CMakeLists.txt @@ -69,7 +69,7 @@ endif() px4_add_module( MODULE systemcmds__tests MAIN tests - STACK 8000 + STACK_MAIN 8000 COMPILE_FLAGS -Wframe-larger-than=6000 -Wno-float-equal diff --git a/src/systemcmds/top/CMakeLists.txt b/src/systemcmds/top/CMakeLists.txt index 0bf73a923c..26099cee46 100644 --- a/src/systemcmds/top/CMakeLists.txt +++ b/src/systemcmds/top/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__top MAIN top - STACK 1700 + STACK_MAIN 1700 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/topic_listener/CMakeLists.txt b/src/systemcmds/topic_listener/CMakeLists.txt index eb3071f41b..17f6957f19 100644 --- a/src/systemcmds/topic_listener/CMakeLists.txt +++ b/src/systemcmds/topic_listener/CMakeLists.txt @@ -43,7 +43,7 @@ add_custom_target(generate_topic_listener px4_add_module( MODULE systemcmds__topic_listener MAIN listener - STACK 1800 + STACK_MAIN 1800 COMPILE_FLAGS -Os SRCS diff --git a/src/systemcmds/ver/CMakeLists.txt b/src/systemcmds/ver/CMakeLists.txt index f6676b1883..c7fa6d7805 100644 --- a/src/systemcmds/ver/CMakeLists.txt +++ b/src/systemcmds/ver/CMakeLists.txt @@ -33,7 +33,7 @@ px4_add_module( MODULE systemcmds__ver MAIN ver - STACK 1024 + STACK_MAIN 1024 COMPILE_FLAGS -Os SRCS