Skip to content

Commit

Permalink
UAVCAN bootloaders split into separate repository
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Sep 4, 2017
1 parent bbd6f7d commit 83e6397
Show file tree
Hide file tree
Showing 107 changed files with 158 additions and 18,904 deletions.
7 changes: 5 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
url = https://github.com/eProsima/micro-CDR.git
[submodule "platforms/nuttx/NuttX/nuttx"]
path = platforms/nuttx/NuttX/nuttx
url = git@github.com:PX4-NuttX/nuttx.git
url = https://github.com/PX4-NuttX/nuttx.git
[submodule "platforms/nuttx/NuttX/apps"]
path = platforms/nuttx/NuttX/apps
url = [email protected]:PX4-NuttX/apps.git
url = https://github.com/PX4-NuttX/apps.git
[submodule "cmake/configs/uavcan_board_ident"]
path = cmake/configs/uavcan_board_ident
url = https://github.com/PX4/uavcan_board_ident.git
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ excelsior_legacy_default: posix_excelsior_legacy qurt_excelsior_legacy
# Other targets
# --------------------------------------------------------------------

.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders sizes check quick_check
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware alt_firmware sizes check quick_check

# QGroundControl flashable NuttX firmware
qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware sizes
Expand Down Expand Up @@ -218,20 +218,11 @@ alt_firmware: \
check_s2740vc-v1_default \
sizes

checks_bootloaders: \
check_esc35-v1_bootloader \
check_px4esc-v1_bootloader \
check_px4flow-v2_bootloader \
check_s2740vc-v1_bootloader \
# not fitting in flash check_px4cannode-v1_bootloader \
# not fitting in flash check_zubaxgnss-v1_bootloader \
sizes

sizes:
@-find build -name *.elf -type f | xargs size 2> /dev/null || :

# All default targets that don't require a special build environment
check: check_posix_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders tests check_format
check: check_posix_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware tests check_format

# quick_check builds a single nuttx and posix target, runs testing, and checks the style
quick_check: check_posix_sitl_default check_px4fmu-v3_default tests check_format
Expand Down
1 change: 1 addition & 0 deletions ROMFS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ add_custom_command(OUTPUT nsh_romfsimg.c
)

add_library(romfs STATIC nsh_romfsimg.c)
add_dependencies(romfs platforms__common)
set_target_properties(romfs PROPERTIES LINKER_LANGUAGE C)
173 changes: 84 additions & 89 deletions cmake/common/px4_metadata.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

#=============================================================================
Expand Down
2 changes: 0 additions & 2 deletions cmake/configs/nuttx_esc35-v1_bootloader.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/nuttx_esc35-v1_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions cmake/configs/nuttx_px4cannode-v1_bootloader.cmake

This file was deleted.

4 changes: 1 addition & 3 deletions cmake/configs/nuttx_px4cannode-v1_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ 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}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor}
)

include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4cannode-v1/bootloader)

set(config_module_list
#
# Board support modules
Expand Down
2 changes: 0 additions & 2 deletions cmake/configs/nuttx_px4esc-v1_bootloader.cmake

This file was deleted.

4 changes: 1 addition & 3 deletions cmake/configs/nuttx_px4esc-v1_default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ 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}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor}
)

include_directories(${PX4_SOURCE_DIR}/src/drivers/boards/px4esc-v1/bootloader)

set(config_module_list
#
# Board support modules
Expand Down
2 changes: 0 additions & 2 deletions cmake/configs/nuttx_px4flow-v2_bootloader.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions cmake/configs/nuttx_s2740vc-v1_bootloader.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions cmake/configs/nuttx_zubaxgnss-v1_bootloader.cmake

This file was deleted.

1 change: 1 addition & 0 deletions cmake/configs/uavcan_board_ident
Submodule uavcan_board_ident added at f8851c
3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/esc35-v1.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/px4cannode-v1.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/px4esc-v1.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/px4flow-v2.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/s2740vc-v1.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/configs/uavcan_board_ident/zubaxgnss-v1.cmake

This file was deleted.

14 changes: 2 additions & 12 deletions cmake/nuttx/px4_impl_nuttx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -271,7 +269,6 @@ endfunction()
# Usage:
# px4_nuttx_configure(
# HWCLASS <m3|m4>
# CONFIG <nsh|bootloader
# [ROMFS <y|n>
# ROMFSROOT <root>]
# )
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 83e6397

Please sign in to comment.