forked from Archive/PX4-Autopilot
Use the value of nuttx CONFIG_ARMV7M_STACKCHECK to configure PX4 build for HW stack checking
This commit is contained in:
parent
be92040fe9
commit
4e26c7fcd4
|
@ -202,6 +202,16 @@ function(px4_nuttx_add_export)
|
||||||
add_dependencies(nuttx_patch nuttx_patch_${patch_name})
|
add_dependencies(nuttx_patch nuttx_patch_${patch_name})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
|
||||||
|
# note: CONFIG will be BOARD in the future evaluation of ${hw_stack_check_${CONFIG}
|
||||||
|
file(STRINGS "${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig"
|
||||||
|
hw_stack_check_${CONFIG}
|
||||||
|
REGEX "CONFIG_ARMV7M_STACKCHECK=y"
|
||||||
|
)
|
||||||
|
if ("${hw_stack_check_${CONFIG}}" STREQUAL "CONFIG_ARMV7M_STACKCHECK=y")
|
||||||
|
set(config_nuttx_hw_stack_check_${CONFIG} y CACHE INTERNAL "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# copy and export
|
# copy and export
|
||||||
file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
||||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||||
|
@ -428,6 +438,16 @@ function(px4_os_add_flags)
|
||||||
|
|
||||||
set(added_exe_linker_flags) # none currently
|
set(added_exe_linker_flags) # none currently
|
||||||
|
|
||||||
|
set(instrument_flags)
|
||||||
|
if ("${config_nuttx_hw_stack_check_${BOARD}}" STREQUAL "y")
|
||||||
|
set(instrument_flags
|
||||||
|
-finstrument-functions
|
||||||
|
-ffixed-r10
|
||||||
|
)
|
||||||
|
list(APPEND c_flags ${instrument_flags})
|
||||||
|
list(APPEND cxx_flags ${instrument_flags})
|
||||||
|
endif()
|
||||||
|
|
||||||
set(cpu_flags)
|
set(cpu_flags)
|
||||||
if (${BOARD} STREQUAL "px4fmu-v1")
|
if (${BOARD} STREQUAL "px4fmu-v1")
|
||||||
set(cpu_flags
|
set(cpu_flags
|
||||||
|
|
Loading…
Reference in New Issue