mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 02:13:33 +08:00
Critical: Fixes Snapdragon Flight parameter synchronization problem (#6910)
* cmake: Fixes problem caused when the generated parameters.xml differs for the ARM and DSP builds. * fix px4_getopt.h: add accidentally removed file
This commit is contained in:
committed by
ChristophTobler
parent
7ef3b92109
commit
d7703173b2
+25
-10
@@ -1032,12 +1032,16 @@ function(px4_generate_parameters_xml)
|
||||
if (NOT OVERRIDES)
|
||||
set(OVERRIDES "{}")
|
||||
endif()
|
||||
|
||||
|
||||
# get full path for each module
|
||||
set(module_list)
|
||||
foreach(module ${MODULES})
|
||||
list(APPEND module_list ${PX4_SOURCE_DIR}/src/${module})
|
||||
endforeach()
|
||||
if(DISABLE_PARAMS_MODULE_SCOPING)
|
||||
set(module_list ${path})
|
||||
else()
|
||||
foreach(module ${MODULES})
|
||||
list(APPEND module_list ${PX4_SOURCE_DIR}/src/${module})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${OUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
|
||||
@@ -1046,7 +1050,8 @@ function(px4_generate_parameters_xml)
|
||||
--overrides ${OVERRIDES}
|
||||
DEPENDS ${param_src_files} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
|
||||
${PX4_SOURCE_DIR}/Tools/px_generate_params.py
|
||||
)
|
||||
)
|
||||
|
||||
set(${OUT} ${${OUT}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -1082,12 +1087,22 @@ function(px4_generate_parameters_source)
|
||||
${CMAKE_CURRENT_BINARY_DIR}/px4_parameters.c)
|
||||
set_source_files_properties(${generated_files}
|
||||
PROPERTIES GENERATED TRUE)
|
||||
px4_join(OUT module_list LIST ${MODULES} GLUE ",")
|
||||
add_custom_command(OUTPUT ${generated_files}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_generate_params.py
|
||||
--xml ${XML} --modules ${module_list} --dest ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${XML} ${DEPS}
|
||||
|
||||
if(DISABLE_PARAMS_MODULE_SCOPING)
|
||||
add_custom_command(OUTPUT ${generated_files}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_generate_params.py
|
||||
--xml ${XML} --dest ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${XML} ${DEPS}
|
||||
)
|
||||
else()
|
||||
px4_join(OUT module_list LIST ${MODULES} GLUE ",")
|
||||
add_custom_command(OUTPUT ${generated_files}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_generate_params.py
|
||||
--xml ${XML} --modules ${module_list} --dest ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${XML} ${DEPS}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(${OUT} ${generated_files} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ endif()
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake)
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -4,7 +4,7 @@ set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolcha
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -11,7 +11,12 @@ set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolcha
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -2,7 +2,12 @@ include(posix/px4_impl_posix)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -6,7 +6,7 @@ else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -6,7 +6,7 @@ else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -6,7 +6,7 @@ else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -6,7 +6,7 @@ else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -11,7 +11,7 @@ else()
|
||||
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
|
||||
endif()
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
|
||||
@@ -8,8 +8,6 @@ endif()
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
@@ -17,6 +15,13 @@ else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
include(toolchain/Toolchain-qurt)
|
||||
include(qurt_flags)
|
||||
|
||||
@@ -8,8 +8,6 @@ endif()
|
||||
|
||||
set(CONFIG_SHMEM "1")
|
||||
|
||||
set(config_generate_parameters_scope ALL)
|
||||
|
||||
# Get $QC_SOC_TARGET from environment if existing.
|
||||
if (DEFINED ENV{QC_SOC_TARGET})
|
||||
set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
|
||||
@@ -17,6 +15,13 @@ else()
|
||||
set(QC_SOC_TARGET "APQ8074")
|
||||
endif()
|
||||
|
||||
# Disable the creation of the parameters.xml file by scanning individual
|
||||
# source files, and scan all source files. This will create a parameters.xml
|
||||
# file that contains all possible parameters, even if the associated module
|
||||
# is not used. This is necessary for parameter synchronization between the
|
||||
# ARM and DSP processors.
|
||||
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
include(toolchain/Toolchain-qurt)
|
||||
include(qurt_flags)
|
||||
|
||||
Reference in New Issue
Block a user