mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
UAVCAN bootloaders split into separate repository (#7878)
This commit is contained in:
@@ -73,102 +73,97 @@ function(px4_generate_messages)
|
||||
REQUIRED MSG_FILES OS TARGET
|
||||
ARGN ${ARGN})
|
||||
|
||||
if("${nuttx_config_type}" STREQUAL "bootloader")
|
||||
# do nothing for bootloaders
|
||||
else()
|
||||
set(QUIET)
|
||||
if (NOT VERBOSE)
|
||||
set(QUIET "-q")
|
||||
endif()
|
||||
|
||||
set(QUIET)
|
||||
if (NOT VERBOSE)
|
||||
set(QUIET "-q")
|
||||
endif()
|
||||
# headers
|
||||
set(msg_out_path ${PX4_BINARY_DIR}/src/modules/uORB/topics)
|
||||
set(msg_list)
|
||||
foreach(msg_file ${MSG_FILES})
|
||||
get_filename_component(msg ${msg_file} NAME_WE)
|
||||
list(APPEND msg_list ${msg})
|
||||
endforeach()
|
||||
|
||||
# headers
|
||||
set(msg_out_path ${PX4_BINARY_DIR}/src/modules/uORB/topics)
|
||||
set(msg_list)
|
||||
foreach(msg_file ${MSG_FILES})
|
||||
get_filename_component(msg ${msg_file} NAME_WE)
|
||||
list(APPEND msg_list ${msg})
|
||||
endforeach()
|
||||
set(msg_files_out)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_files_out ${msg_out_path}/${msg}.h)
|
||||
endforeach()
|
||||
|
||||
set(msg_files_out)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_files_out ${msg_out_path}/${msg}.h)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_header
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic headers"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${msg_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_header
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic headers"
|
||||
VERBATIM
|
||||
)
|
||||
# !sources
|
||||
set(msg_source_out_path ${PX4_BINARY_DIR}/topics_sources)
|
||||
set(msg_source_files_out ${msg_source_out_path}/uORBTopics.cpp)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_source_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--sources
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_source_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_sources
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic sources"
|
||||
VERBATIM
|
||||
)
|
||||
set_source_files_properties(${msg_source_files_out} PROPERTIES GENERATED TRUE)
|
||||
|
||||
# !sources
|
||||
set(msg_source_out_path ${PX4_BINARY_DIR}/topics_sources)
|
||||
set(msg_source_files_out ${msg_source_out_path}/uORBTopics.cpp)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_source_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--sources
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_source_out_path}
|
||||
-e msg/templates/uorb
|
||||
-t ${PX4_BINARY_DIR}/topics_temporary_sources
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic sources"
|
||||
VERBATIM
|
||||
)
|
||||
set_source_files_properties(${msg_source_files_out} PROPERTIES GENERATED TRUE)
|
||||
# multi messages for target OS
|
||||
set(msg_multi_out_path ${PX4_BINARY_DIR}/src/platforms/${OS}/px4_messages)
|
||||
set(msg_multi_files_out)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_multi_files_out ${msg_multi_out_path}/px4_${msg}.h)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_multi_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_multi_out_path}
|
||||
-e msg/templates/px4/uorb
|
||||
-t ${PX4_BINARY_DIR}/multi_topics_temporary/${OS}
|
||||
-p "px4_"
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic multi headers for ${OS}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# multi messages for target OS
|
||||
set(msg_multi_out_path ${PX4_BINARY_DIR}/src/platforms/${OS}/px4_messages)
|
||||
set(msg_multi_files_out)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_multi_files_out ${msg_multi_out_path}/px4_${msg}.h)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_multi_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
${QUIET}
|
||||
-f ${MSG_FILES}
|
||||
-i ${INCLUDES}
|
||||
-o ${msg_multi_out_path}
|
||||
-e msg/templates/px4/uorb
|
||||
-t ${PX4_BINARY_DIR}/multi_topics_temporary/${OS}
|
||||
-p "px4_"
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic multi headers for ${OS}"
|
||||
VERBATIM
|
||||
)
|
||||
px4_add_library(${TARGET}
|
||||
${msg_source_files_out}
|
||||
${msg_multi_files_out}
|
||||
${msg_files_out}
|
||||
)
|
||||
|
||||
px4_add_library(${TARGET}
|
||||
${msg_source_files_out}
|
||||
${msg_multi_files_out}
|
||||
${msg_files_out}
|
||||
)
|
||||
|
||||
target_include_directories(${TARGET}
|
||||
PRIVATE ${PX4_SOURCE_DIR}/src/lib/micro-CDR/include
|
||||
PRIVATE ${PX4_BINARY_DIR}/src/lib/micro-CDR/include/microcdr
|
||||
)
|
||||
target_link_libraries(${TARGET} PRIVATE lib__micro-CDR)
|
||||
endif()
|
||||
target_include_directories(${TARGET}
|
||||
PRIVATE ${PX4_SOURCE_DIR}/src/lib/micro-CDR/include
|
||||
PRIVATE ${PX4_BINARY_DIR}/src/lib/micro-CDR/include/microcdr
|
||||
)
|
||||
target_link_libraries(${TARGET} PRIVATE lib__micro-CDR)
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
|
||||
@@ -34,14 +34,11 @@ px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
|
||||
SW_MINOR ${uavcanblid_sw_version_minor}
|
||||
)
|
||||
|
||||
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/esc35-v1/bootloader)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/boards
|
||||
drivers/bootloaders
|
||||
drivers/device
|
||||
drivers/led
|
||||
drivers/stm32
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
|
||||
@@ -24,7 +24,7 @@ add_definitions(
|
||||
)
|
||||
|
||||
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
|
||||
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/px4cannode-v1.bin
|
||||
BIN ${PX4_BINARY_DIR}/src/firmware/nuttx/px4cannode-v1.bin
|
||||
HWNAME ${uavcanblid_name}
|
||||
HW_MAJOR ${uavcanblid_hw_version_major}
|
||||
HW_MINOR ${uavcanblid_hw_version_minor}
|
||||
@@ -32,8 +32,6 @@ px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
|
||||
SW_MINOR ${uavcanblid_sw_version_minor}
|
||||
)
|
||||
|
||||
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4cannode-v1/bootloader)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
|
||||
@@ -26,7 +26,7 @@ add_definitions(
|
||||
)
|
||||
|
||||
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
|
||||
BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/px4esc-v1.bin
|
||||
BIN ${PX4_BINARY_DIR}/src/firmware/nuttx/px4esc-v1.bin
|
||||
HWNAME ${uavcanblid_name}
|
||||
HW_MAJOR ${uavcanblid_hw_version_major}
|
||||
HW_MINOR ${uavcanblid_hw_version_minor}
|
||||
@@ -34,8 +34,6 @@ px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
|
||||
SW_MINOR ${uavcanblid_sw_version_minor}
|
||||
)
|
||||
|
||||
include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4esc-v1/bootloader)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
|
||||
@@ -1,2 +0,0 @@
|
||||
include(nuttx/px4_uavcan_bootloader)
|
||||
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
|
||||
1
cmake/configs/uavcan_board_ident
Submodule
1
cmake/configs/uavcan_board_ident
Submodule
Submodule cmake/configs/uavcan_board_ident added at f8851c841e
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 1)
|
||||
set(uavcanblid_hw_version_minor 0)
|
||||
set(uavcanblid_name "\"com.auav.esc35-v1\"")
|
||||
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 1)
|
||||
set(uavcanblid_hw_version_minor 0)
|
||||
set(uavcanblid_name "\"org.pixhawk.px4cannode-v1\"")
|
||||
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 1)
|
||||
set(uavcanblid_hw_version_minor 6)
|
||||
set(uavcanblid_name "\"org.pixhawk.px4esc-v1\"")
|
||||
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 2)
|
||||
set(uavcanblid_hw_version_minor 0)
|
||||
set(uavcanblid_name "\"org.pixhawk.px4flow-v2\"")
|
||||
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 1)
|
||||
set(uavcanblid_hw_version_minor 0)
|
||||
set(uavcanblid_name "\"com.thiemar.s2740vc-v1\"")
|
||||
@@ -1,3 +0,0 @@
|
||||
set(uavcanblid_hw_version_major 1)
|
||||
set(uavcanblid_hw_version_minor 0)
|
||||
set(uavcanblid_name "\"com.zubax.gnss\"")
|
||||
@@ -188,9 +188,7 @@ function(px4_os_add_flags)
|
||||
#set(added_link_dirs ${nuttx_export_dir}/libs)
|
||||
set(added_definitions -D__PX4_NUTTX)
|
||||
|
||||
if(NOT ${nuttx_config_type} STREQUAL "bootloader")
|
||||
list(APPEND added_definitions -D__DF_NUTTX)
|
||||
endif()
|
||||
list(APPEND added_definitions -D__DF_NUTTX)
|
||||
|
||||
if("${config_nuttx_hw_stack_check_${BOARD}}" STREQUAL "y")
|
||||
set(instrument_flags
|
||||
@@ -241,7 +239,7 @@ function(px4_os_prebuild_targets)
|
||||
add_custom_target(${OUT} DEPENDS nuttx_context)
|
||||
|
||||
# parse nuttx config options for cmake
|
||||
file(STRINGS ${PX4_SOURCE_DIR}/nuttx-configs/${BOARD}/${nuttx_config_type}/defconfig ConfigContents)
|
||||
file(STRINGS ${PX4_SOURCE_DIR}/nuttx-configs/${BOARD}/nsh/defconfig ConfigContents)
|
||||
foreach(NameAndValue ${ConfigContents})
|
||||
# Strip leading spaces
|
||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||
@@ -271,7 +269,6 @@ endfunction()
|
||||
# Usage:
|
||||
# px4_nuttx_configure(
|
||||
# HWCLASS <m3|m4>
|
||||
# CONFIG <nsh|bootloader
|
||||
# [ROMFS <y|n>
|
||||
# ROMFSROOT <root>]
|
||||
# )
|
||||
@@ -306,13 +303,6 @@ function(px4_nuttx_configure)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "system processor" FORCE)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake CACHE INTERNAL "toolchain file" FORCE)
|
||||
|
||||
# CONFIG (nsh/bootloader)
|
||||
if(CONFIG)
|
||||
set(nuttx_config_type ${CONFIG} PARENT_SCOPE)
|
||||
else()
|
||||
set(nuttx_config_type "nsh" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# ROMFS
|
||||
if("${ROMFS}" STREQUAL "y")
|
||||
if (NOT DEFINED ROMFSROOT)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2017 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
message(STATUS "PX4 bootloader: ${BOARD}")
|
||||
|
||||
# Bring in common uavcan hardware identity definitions
|
||||
include(configs/uavcan_board_ident/${BOARD})
|
||||
add_definitions(
|
||||
-DHW_UAVCAN_NAME=${uavcanblid_name}
|
||||
-DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
|
||||
-DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
|
||||
)
|
||||
|
||||
include_directories(src/drivers/boards/${BOARD}/bootloader)
|
||||
|
||||
set(config_module_list
|
||||
drivers/boards/common
|
||||
drivers/boards/${BOARD}/bootloader
|
||||
drivers/bootloaders
|
||||
)
|
||||
|
||||
add_library(nuttx_startup ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/arch/arm/src/stm32/gnu/stm32_vectors.S)
|
||||
target_compile_definitions(nuttx_startup PRIVATE -D__ASSEMBLY__)
|
||||
add_dependencies(nuttx_startup nuttx_arch_build)
|
||||
Reference in New Issue
Block a user