mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 09:11:37 +08:00
Working on param xml gen. Haven't updated qurt config yet.
This commit is contained in:
+2
-2
@@ -130,7 +130,7 @@ endif()
|
|||||||
set(px4_required_functions
|
set(px4_required_functions
|
||||||
px4_os_prebuild_targets
|
px4_os_prebuild_targets
|
||||||
px4_os_add_flags
|
px4_os_add_flags
|
||||||
px4_set_config_modules
|
px4_get_config
|
||||||
)
|
)
|
||||||
foreach(cmd ${px4_required_functions})
|
foreach(cmd ${px4_required_functions})
|
||||||
if(NOT COMMAND ${cmd})
|
if(NOT COMMAND ${cmd})
|
||||||
@@ -235,7 +235,7 @@ px4_generate_messages(TARGET msg_gen
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
# subdirectories
|
# subdirectories
|
||||||
#
|
#
|
||||||
px4_set_config_modules(config_modules)
|
px4_get_config(OUT_MODULES config_modules)
|
||||||
set(module_libraries)
|
set(module_libraries)
|
||||||
foreach(module ${config_modules})
|
foreach(module ${config_modules})
|
||||||
add_subdirectory(src/${module})
|
add_subdirectory(src/${module})
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
include(nuttx/px4_impl_nuttx)
|
include(nuttx/px4_impl_nuttx)
|
||||||
|
|
||||||
function(px4_set_config_modules out_module_list)
|
function(px4_get_config)
|
||||||
|
|
||||||
|
px4_parse_function_args(
|
||||||
|
NAME px4_set_config_modules
|
||||||
|
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
|
|
||||||
#
|
#
|
||||||
# Board support modules
|
# Board support modules
|
||||||
#
|
#
|
||||||
@@ -161,25 +165,39 @@ function(px4_set_config_modules out_module_list)
|
|||||||
#examples/hwtest
|
#examples/hwtest
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO convert rest of makefile config below
|
set(firmware_options
|
||||||
|
PARAM_XML # generate param xml
|
||||||
|
)
|
||||||
|
|
||||||
# Generate parameter XML file
|
set(extra_cmds serdis_main sercon_main)
|
||||||
#GEN_PARAM_XML = 1
|
|
||||||
|
|
||||||
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
|
# output
|
||||||
|
if(OUT_MODULES)
|
||||||
|
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (OUT_FW_OPTS)
|
||||||
|
set(${OUT_FW_OPTS} ${fw_opts} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(px4_nuttx_builtin_extra_commands out)
|
function(px4_add_extra_builtin_cmds)
|
||||||
|
|
||||||
add_custom_target(sercon_main)
|
px4_parse_function_args(
|
||||||
set_target_properties(sercon_main PROPERTIES
|
NAME px4_add_extra_builtin_cmds
|
||||||
|
ONE_VALUE OUT
|
||||||
|
REQUIRED OUT
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
|
add_custom_target(sercon)
|
||||||
|
set_target_properties(sercon PROPERTIES
|
||||||
MAIN "sercon" STACK "2048")
|
MAIN "sercon" STACK "2048")
|
||||||
|
|
||||||
add_custom_target(serdis_main)
|
add_custom_target(serdis)
|
||||||
set_target_properties(serdis_main PROPERTIES
|
set_target_properties(serdis PROPERTIES
|
||||||
MAIN "serdis" STACK "2048")
|
MAIN "serdis" STACK "2048")
|
||||||
|
|
||||||
set(${out} sercon_main serdis_main PARENT_SCOPE)
|
set(${OUT} sercon serdis PARENT_SCOPE)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
include(nuttx/px4_impl_nuttx)
|
include(nuttx/px4_impl_nuttx)
|
||||||
|
|
||||||
function(px4_set_config_modules out_module_list)
|
function(px4_get_config)
|
||||||
|
|
||||||
|
px4_parse_function_args(
|
||||||
|
NAME px4_set_config_modules
|
||||||
|
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
|
|
||||||
@@ -117,25 +122,39 @@ function(px4_set_config_modules out_module_list)
|
|||||||
examples/hwtest
|
examples/hwtest
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO convert rest of makefile config below
|
set(firmware_options
|
||||||
|
PARAM_XML # generate param xml
|
||||||
|
)
|
||||||
|
|
||||||
# Generate parameter XML file
|
set(extra_cmds serdis_main sercon_main)
|
||||||
#GEN_PARAM_XML = 1
|
|
||||||
|
|
||||||
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
|
# output
|
||||||
|
if(OUT_MODULES)
|
||||||
|
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (OUT_FW_OPTS)
|
||||||
|
set(${OUT_FW_OPTS} ${fw_opts} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(px4_nuttx_builtin_extra_commands out)
|
function(px4_add_extra_builtin_cmds)
|
||||||
|
|
||||||
add_custom_target(sercon_main)
|
px4_parse_function_args(
|
||||||
set_target_properties(sercon_main PROPERTIES
|
NAME px4_add_extra_builtin_cmds
|
||||||
|
ONE_VALUE OUT
|
||||||
|
REQUIRED OUT
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
|
add_custom_target(sercon)
|
||||||
|
set_target_properties(sercon PROPERTIES
|
||||||
MAIN "sercon" STACK "2048")
|
MAIN "sercon" STACK "2048")
|
||||||
|
|
||||||
add_custom_target(serdis_main)
|
add_custom_target(serdis)
|
||||||
set_target_properties(serdis_main PROPERTIES
|
set_target_properties(serdis PROPERTIES
|
||||||
MAIN "serdis" STACK "2048")
|
MAIN "serdis" STACK "2048")
|
||||||
|
|
||||||
set(${out} sercon_main serdis_main PARENT_SCOPE)
|
set(${OUT} sercon serdis PARENT_SCOPE)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
include(posix/px4_impl_posix)
|
include(posix/px4_impl_posix)
|
||||||
|
|
||||||
function(px4_set_config_modules out_module_list)
|
function(px4_get_config)
|
||||||
|
|
||||||
|
px4_parse_function_args(
|
||||||
|
NAME px4_set_config_modules
|
||||||
|
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/led
|
drivers/led
|
||||||
@@ -54,7 +59,39 @@ function(px4_set_config_modules out_module_list)
|
|||||||
lib/launchdetection
|
lib/launchdetection
|
||||||
)
|
)
|
||||||
|
|
||||||
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
|
set(firmware_options
|
||||||
|
PARAM_XML # generate param xml
|
||||||
|
)
|
||||||
|
|
||||||
|
set(extra_cmds serdis_main sercon_main)
|
||||||
|
|
||||||
|
# output
|
||||||
|
if(OUT_MODULES)
|
||||||
|
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (OUT_FW_OPTS)
|
||||||
|
set(${OUT_FW_OPTS} ${fw_opts} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(px4_add_extra_builtin_cmds)
|
||||||
|
|
||||||
|
px4_parse_function_args(
|
||||||
|
NAME px4_add_extra_builtin_cmds
|
||||||
|
ONE_VALUE OUT
|
||||||
|
REQUIRED OUT
|
||||||
|
ARGN ${ARGN})
|
||||||
|
|
||||||
|
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")
|
||||||
|
|
||||||
|
set(${OUT} sercon serdis PARENT_SCOPE)
|
||||||
|
|
||||||
|
endfunction()
|
||||||
|
|||||||
@@ -79,16 +79,40 @@ function(px4_nuttx_add_firmware)
|
|||||||
REQUIRED EXE
|
REQUIRED EXE
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
|
|
||||||
|
set(process_params ${CMAKE_SOURCE_DIR}/Tools/px_process_params.py)
|
||||||
|
set(process_airframes ${CMAKE_SOURCE_DIR}/Tools/px_process_airframes.py)
|
||||||
|
|
||||||
|
|
||||||
#TODO handle param_xml
|
#TODO handle param_xml
|
||||||
add_custom_command(OUTPUT ${OUT}
|
if(PARAM_XML)
|
||||||
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
|
add_custom_command(OUTPUT ${OUT}
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_mkfw.py
|
COMMAND ${process_params}
|
||||||
--prototype ${CMAKE_SOURCE_DIR}/Images/${BOARD}.prototype
|
--src-path ${CMAKE_SOURCE_DIR}/src
|
||||||
--git_identity ${CMAKE_SOURCE_DIR}
|
--board CONFIG_ARCH_BOARD_${BOARD} --xml
|
||||||
--image ${EXE}.bin > ${OUT}
|
COMMAND ${process_airframes}
|
||||||
DEPENDS ${EXE}
|
-a ${CMAKE_SOURCE_DIR}/ROMFS/px4fmu_common/init.d
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
--board CONFIG_ARCH_BOARD_${BOARD} --xml
|
||||||
)
|
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_mkfw.py
|
||||||
|
--prototype ${CMAKE_SOURCE_DIR}/Images/${BOARD}.prototype
|
||||||
|
--git_identity ${CMAKE_SOURCE_DIR}
|
||||||
|
--parameter_xml parameters.xml
|
||||||
|
--airframe_xml airframe.xml
|
||||||
|
--image ${EXE}.bin > ${OUT}
|
||||||
|
DEPENDS ${EXE}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_command(OUTPUT ${OUT}
|
||||||
|
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_mkfw.py
|
||||||
|
--prototype ${CMAKE_SOURCE_DIR}/Images/${BOARD}.prototype
|
||||||
|
--git_identity ${CMAKE_SOURCE_DIR}
|
||||||
|
--image ${EXE}.bin > ${OUT}
|
||||||
|
DEPENDS ${EXE}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in
|
|
||||||
# the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
|
||||||
# used to endorse or promote products derived from this software
|
|
||||||
# without specific prior written permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
||||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
||||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
||||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
||||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
||||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
||||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
px4_add_module(
|
|
||||||
MODULE
|
|
||||||
DEPENDS
|
|
||||||
platforms__common
|
|
||||||
)
|
|
||||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
px4_nuttx_builtin_extra_commands(builtin_extra_cmds)
|
px4_add_extra_builtin_cmds(OUT extra_builtins)
|
||||||
message(STATUS "builtin extra: ${builtin_extra_cmds}")
|
|
||||||
|
|
||||||
px4_nuttx_generate_builtin_commands(
|
px4_nuttx_generate_builtin_commands(
|
||||||
OUT builtin_commands.c
|
OUT builtin_commands.c
|
||||||
MODULE_LIST ${module_libraries} ${builtin_extra_cmds})
|
MODULE_LIST ${module_libraries} ${extra_builtins}
|
||||||
|
)
|
||||||
|
|
||||||
px4_nuttx_generate_romfs(OUT romfs.o
|
px4_nuttx_generate_romfs(OUT romfs.o
|
||||||
ROOT ROMFS/px4fmu_common)
|
ROOT ROMFS/px4fmu_common)
|
||||||
@@ -27,8 +27,11 @@ target_link_libraries(firmware_nuttx
|
|||||||
apps nuttx nosys m gcc
|
apps nuttx nosys m gcc
|
||||||
-Wl,--end-group)
|
-Wl,--end-group)
|
||||||
|
|
||||||
|
px4_get_config(OUT_FW_OPTS fw_opts)
|
||||||
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4
|
px4_nuttx_add_firmware(OUT ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4
|
||||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx)
|
EXE ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx
|
||||||
|
${fw_opts}
|
||||||
|
)
|
||||||
|
|
||||||
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
px4_add_upload(OUT upload OS ${OS} BOARD ${BOARD}
|
||||||
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/fw_main.px4)
|
||||||
|
|||||||
Reference in New Issue
Block a user