diff --git a/boards/atlflight/eagle/CMakeLists.txt b/boards/atlflight/eagle/CMakeLists.txt new file mode 100644 index 0000000000..5739c31245 --- /dev/null +++ b/boards/atlflight/eagle/CMakeLists.txt @@ -0,0 +1,65 @@ +############################################################################ +# +# Copyright (c) 2018 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. +# +############################################################################ + +add_subdirectory(bbblue_adc) + + +############################################################################ +# Upload +############################################################################ + +if("${PX4_PLATFORM}" MATCHES "qurt") + + add_custom_target(upload + COMMAND + ${PX4_SOURCE_DIR}/Tools/adb_upload.sh + ${CMAKE_CURRENT_BINARY_DIR}/libpx4.so ${CMAKE_CURRENT_BINARY_DIR}/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config # source + /usr/share/data/adsp # destination + DEPENDS px4 px4muorb_skel + COMMENT "uploading px4" + USES_TERMINAL + ) + +else() + + add_custom_target(upload + COMMAND + ${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload.sh + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config # source + /home/linaro # destination + DEPENDS px4 + COMMENT "uploading px4" + USES_TERMINAL + ) + +endif() diff --git a/Tools/adb_upload.sh b/boards/atlflight/eagle/scripts/adb_upload.sh similarity index 100% rename from Tools/adb_upload.sh rename to boards/atlflight/eagle/scripts/adb_upload.sh diff --git a/boards/beaglebone/blue/CMakeLists.txt b/boards/beaglebone/blue/CMakeLists.txt index 4d64c03d75..479f6d55c4 100644 --- a/boards/beaglebone/blue/CMakeLists.txt +++ b/boards/beaglebone/blue/CMakeLists.txt @@ -32,3 +32,15 @@ ############################################################################ add_subdirectory(bbblue_adc) + + +############################################################################ +# Upload +############################################################################ + +add_custom_target(upload + COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_SOURCE_DIR}/ROMFS debian@BBBluePX4:/home/debian/px4 + DEPENDS px4 + COMMENT "uploading px4 and data files" + USES_TERMINAL + ) diff --git a/boards/emlid/navio2/CMakeLists.txt b/boards/emlid/navio2/CMakeLists.txt index b347a5e825..2245838e0a 100644 --- a/boards/emlid/navio2/CMakeLists.txt +++ b/boards/emlid/navio2/CMakeLists.txt @@ -34,3 +34,15 @@ add_subdirectory(navio_adc) add_subdirectory(navio_rgbled) add_subdirectory(navio_sysfs_rc_in) + + +############################################################################ +# Upload +############################################################################ + +add_custom_target(upload + COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"$ENV{AUTOPILOT_HOST}":/home/pi + DEPENDS px4 + COMMENT "uploading px4" + USES_TERMINAL + ) diff --git a/boards/intel/aerofc-v1/CMakeLists.txt b/boards/intel/aerofc-v1/CMakeLists.txt index d5a0096ec6..342bbda02c 100644 --- a/boards/intel/aerofc-v1/CMakeLists.txt +++ b/boards/intel/aerofc-v1/CMakeLists.txt @@ -32,3 +32,16 @@ ############################################################################ add_subdirectory(aerofc_adc) + + + +############################################################################ +# Upload +############################################################################ + +add_custom_target(upload + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/aero_upload.sh $ + DEPENDS px4 + COMMENT "uploading px4" + USES_TERMINAL +) diff --git a/Tools/aero_upload.sh b/boards/intel/aerofc-v1/scripts/aero_upload.sh similarity index 100% rename from Tools/aero_upload.sh rename to boards/intel/aerofc-v1/scripts/aero_upload.sh diff --git a/boards/parrot/bebop/CMakeLists.txt b/boards/parrot/bebop/CMakeLists.txt index 650c1b615e..542377683c 100644 --- a/boards/parrot/bebop/CMakeLists.txt +++ b/boards/parrot/bebop/CMakeLists.txt @@ -32,3 +32,15 @@ ############################################################################ add_subdirectory(flow) + + +############################################################################ +# Upload +############################################################################ + +add_custom_target(upload + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. /data/ftp/internal_000 + DEPENDS px4 + COMMENT "uploading px4" + USES_TERMINAL + ) diff --git a/Tools/adb_upload_to_bebop.sh b/boards/parrot/bebop/scripts/adb_upload_to_bebop.sh similarity index 100% rename from Tools/adb_upload_to_bebop.sh rename to boards/parrot/bebop/scripts/adb_upload_to_bebop.sh diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index 1d614a0c32..4eb10a1bcf 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -35,10 +35,10 @@ include(cygwin_cygpath) add_subdirectory(src) +add_executable(px4 ${PX4_SOURCE_DIR}/src/platforms/empty.c) set(FW_NAME ${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf) - -add_executable(${FW_NAME} ${PX4_SOURCE_DIR}/src/platforms/empty.c) -add_dependencies(${FW_NAME} git_nuttx nuttx_build) +set_target_properties(px4 PROPERTIES OUTPUT_NAME ${FW_NAME}) +add_dependencies(px4 git_nuttx nuttx_build) get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES) @@ -81,7 +81,7 @@ target_link_libraries(nuttx_arch target_link_libraries(nuttx_c INTERFACE nuttx_drivers) target_link_libraries(nuttx_cxx INTERFACE nuttx_c) -target_link_libraries(${FW_NAME} PRIVATE +target_link_libraries(px4 PRIVATE -nodefaultlibs -nostdlib @@ -101,140 +101,129 @@ target_link_libraries(${FW_NAME} PRIVATE m ) -target_link_libraries(${FW_NAME} PRIVATE ${module_libraries}) -target_link_libraries(${FW_NAME} PRIVATE modules__uORB) +target_link_libraries(px4 PRIVATE ${module_libraries}) +target_link_libraries(px4 PRIVATE modules__uORB) if (config_romfs_root) add_subdirectory(${PX4_SOURCE_DIR}/ROMFS ${PX4_BINARY_DIR}/ROMFS) - target_link_libraries(${FW_NAME} PRIVATE romfs) + target_link_libraries(px4 PRIVATE romfs) endif() -# create px4 file (combined firmware and metadata) -# for historical reasons we name the final output binary without nuttx_ -set(fw_name_short) -string(REPLACE "nuttx_" "" fw_name_short ${FW_NAME}) - -set(fw_file ${PX4_BINARY_DIR}/${fw_name_short}) -string(REPLACE ".elf" ".px4" fw_file ${fw_file}) - add_custom_command(OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin COMMAND ${CMAKE_OBJCOPY} -O binary ${PX4_BINARY_DIR_REL}/${FW_NAME} ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin - DEPENDS ${FW_NAME} + DEPENDS px4 ) -set(FW_PROTOTYPE ${PX4_BOARD_VENDOR}${PX4_BOARD_MODEL}) - +# create .px4 with parameter and airframe metadata if (TARGET parameters_xml AND TARGET airframes_xml) - add_custom_command(OUTPUT ${fw_file} - COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py - --prototype ${PX4_SOURCE_DIR}/boards/${PX4_BOARD_VENDOR}/${PX4_BOARD_MODEL}/firmware.prototype - --git_identity ${PX4_SOURCE_DIR} - --parameter_xml ${PX4_BINARY_DIR}/parameters.xml - --airframe_xml ${PX4_BINARY_DIR}/airframes.xml - --image ${PX4_BINARY_DIR}/${PX4_BOARD}.bin > ${fw_file} - DEPENDS ${PX4_BINARY_DIR}/${PX4_BOARD}.bin parameters_xml airframes_xml - COMMENT "Creating ${fw_file}" + + string(REPLACE ".elf" ".px4" fw_package ${FW_NAME}) + + add_custom_command(OUTPUT ${fw_package} + COMMAND + ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py + --prototype ${PX4_SOURCE_DIR}/boards/${PX4_BOARD_VENDOR}/${PX4_BOARD_MODEL}/firmware.prototype + --git_identity ${PX4_SOURCE_DIR} + --parameter_xml ${PX4_BINARY_DIR}/parameters.xml + --airframe_xml ${PX4_BINARY_DIR}/airframes.xml + --image ${PX4_BINARY_DIR}/${PX4_BOARD}.bin > ${fw_package} + DEPENDS + ${PX4_BINARY_DIR}/${PX4_BOARD}.bin + airframes_xml + parameters_xml + COMMENT "Creating ${fw_package}" + WORKING_DIRECTORY ${PX4_BINARY_DIR} ) - add_custom_target(px4 ALL DEPENDS ${fw_file}) + add_custom_target(px4_package ALL DEPENDS ${fw_package}) # upload helper - if (${PX4_BOARD} STREQUAL "aerofc-v1") - - # TODO: should be set only in aero config - add_custom_target(upload - COMMAND ${PX4_SOURCE_DIR}/Tools/aero_upload.sh ${fw_file} - DEPENDS ${fw_file} - COMMENT "uploading px4" - USES_TERMINAL - ) - else() + # create upload target helper if NuttX USB CDCACM is present + if (CONFIG_CDCACM) - # create upload target helper if NuttX USB CDCACM is present - if (CONFIG_CDCACM) + # NuttX CDCACM vendor and product strings + set(vendorstr_underscore) + set(productstr_underscore) + string(REPLACE " " "_" vendorstr_underscore ${CONFIG_CDCACM_VENDORSTR}) + string(REPLACE " " "_" productstr_underscore ${CONFIG_CDCACM_PRODUCTSTR}) - # NuttX CDCACM vendor and product strings - set(vendorstr_underscore) - set(productstr_underscore) - string(REPLACE " " "_" vendorstr_underscore ${CONFIG_CDCACM_VENDORSTR}) - string(REPLACE " " "_" productstr_underscore ${CONFIG_CDCACM_PRODUCTSTR}) + set(serial_ports) + if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") - set(serial_ports) - if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") + set(px4_usb_path "${vendorstr_underscore}_${productstr_underscore}") - set(px4_usb_path "${vendorstr_underscore}_${productstr_underscore}") + list(APPEND serial_ports + # NuttX vendor + product string + /dev/serial/by-id/*-${px4_usb_path}* - list(APPEND serial_ports - # NuttX vendor + product string - /dev/serial/by-id/*-${px4_usb_path}* + # Bootloader + /dev/serial/by-id/*PX4_BL* # typical bootloader USB device string + /dev/serial/by-id/*BL_FMU* - # Bootloader - /dev/serial/by-id/*PX4_BL* # typical bootloader USB device string - /dev/serial/by-id/*BL_FMU* + # TODO: handle these per board + /dev/serial/by-id/usb-The_Autopilot* + /dev/serial/by-id/usb-Bitcraze* + /dev/serial/by-id/pci-Bitcraze* + /dev/serial/by-id/usb-Gumstix* - # TODO: handle these per board - /dev/serial/by-id/usb-The_Autopilot* - /dev/serial/by-id/usb-Bitcraze* - /dev/serial/by-id/pci-Bitcraze* - /dev/serial/by-id/usb-Gumstix* - - ) - - elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin") - list(APPEND serial_ports - /dev/tty.usbmodemPX*,/dev/tty.usbmodem* - ) - elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "CYGWIN") - list(APPEND serial_ports - /dev/ttyS* - ) - elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") - foreach(port RANGE 32 0) - list(APPEND serial_ports - "COM${port}") - endforeach() - endif() - - string(REPLACE ";" "," serial_ports "${serial_ports}") - - add_custom_target(upload - COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${fw_file} - DEPENDS ${fw_file} - COMMENT "uploading px4" - VERBATIM - USES_TERMINAL ) - add_custom_target(force-upload - COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --force --port ${serial_ports} ${fw_file} - DEPENDS ${fw_file} - COMMENT "uploading px4 with --force" - VERBATIM - USES_TERMINAL + elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin") + list(APPEND serial_ports + /dev/tty.usbmodemPX*,/dev/tty.usbmodem* ) + elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "CYGWIN") + list(APPEND serial_ports + /dev/ttyS* + ) + elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") + foreach(port RANGE 32 0) + list(APPEND serial_ports + "COM${port}") + endforeach() endif() + string(REPLACE ";" "," serial_ports "${serial_ports}") + + add_custom_target(upload + COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${fw_package} + DEPENDS ${fw_package} + COMMENT "uploading px4" + VERBATIM + USES_TERMINAL + WORKING_DIRECTORY ${PX4_BINARY_DIR} + ) + + add_custom_target(force-upload + COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --force --port ${serial_ports} ${fw_package} + DEPENDS ${fw_package} + COMMENT "uploading px4 with --force" + VERBATIM + USES_TERMINAL + WORKING_DIRECTORY ${PX4_BINARY_DIR} + ) endif() + endif() # print size add_custom_target(size - COMMAND size ${FW_NAME} - DEPENDS ${FW_NAME} + COMMAND size $ + DEPENDS px4 WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL ) # print weak symbols add_custom_target(weak_symbols - COMMAND ${CMAKE_NM} $ | ${GREP} " w " | cat - DEPENDS ${FW_NAME} + COMMAND ${CMAKE_NM} $ | ${GREP} " w " | cat + DEPENDS px4 VERBATIM USES_TERMINAL ) add_custom_target(stack_check - COMMAND ${CMAKE_COMMAND} -E make_directory stack_usage && ${CMAKE_OBJDUMP} -d $ | ${PX4_SOURCE_DIR}/Tools/stack_usage/checkstack.pl arm 0 > stack_usage/checkstack_output.txt 2> stack_usage/checkstack_errors.txt + COMMAND ${CMAKE_COMMAND} -E make_directory stack_usage && ${CMAKE_OBJDUMP} -d $ | ${PX4_SOURCE_DIR}/Tools/stack_usage/checkstack.pl arm 0 > stack_usage/checkstack_output.txt 2> stack_usage/checkstack_errors.txt COMMAND ${CMAKE_COMMAND} -E echo "" COMMAND ${CMAKE_COMMAND} -E echo "" COMMAND ${CMAKE_COMMAND} -E echo "Top 50:" @@ -244,7 +233,7 @@ add_custom_target(stack_check COMMAND ${CMAKE_COMMAND} -E echo "Symbols with 'run', 'task', 'thread', 'main', 'update':" COMMAND ${CMAKE_COMMAND} -E echo "--------------------------------------------------------------------------------" COMMAND cat stack_usage/checkstack_output.txt | c++filt | grep -E 'run|task|thread|main|update' - DEPENDS ${FW_NAME} + DEPENDS px4 WORKING_DIRECTORY ${PX4_BINARY_DIR} VERBATIM ) @@ -253,29 +242,29 @@ find_program(BLOATY_PROGRAM bloaty) if (BLOATY_PROGRAM) # bloaty symbols add_custom_target(bloaty_symbols - COMMAND ${BLOATY_PROGRAM} -d symbols -C full -n 50 -s vm $ - DEPENDS ${FW_NAME} + COMMAND ${BLOATY_PROGRAM} -d symbols -C full -n 50 -s vm $ + DEPENDS px4 USES_TERMINAL ) # bloaty compilation units add_custom_target(bloaty_compileunits - COMMAND ${BLOATY_PROGRAM} -d compileunits -C full -n 50 -s vm $ - DEPENDS ${FW_NAME} + COMMAND ${BLOATY_PROGRAM} -d compileunits -C full -n 50 -s vm $ + DEPENDS px4 USES_TERMINAL ) # bloaty templates add_custom_target(bloaty_templates - COMMAND ${BLOATY_PROGRAM} -d shortsymbols,fullsymbols -n 50 $ - DEPENDS ${FW_NAME} + COMMAND ${BLOATY_PROGRAM} -d shortsymbols,fullsymbols -n 50 $ + DEPENDS px4 USES_TERMINAL ) # bloaty inlines add_custom_target(bloaty_inlines - COMMAND ${BLOATY_PROGRAM} -d inlines -C full -n 50 $ - DEPENDS ${FW_NAME} + COMMAND ${BLOATY_PROGRAM} -d inlines -C full -n 50 $ + DEPENDS px4 USES_TERMINAL ) @@ -283,8 +272,8 @@ if (BLOATY_PROGRAM) add_custom_target(bloaty_compare_master #COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${FW_NAME} -O master_${FW_NAME} COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf -O master_${FW_NAME} - COMMAND ${BLOATY_PROGRAM} -d symbols -n 50 -C full -s vm $ -- master_${FW_NAME} - DEPENDS ${FW_NAME} + COMMAND ${BLOATY_PROGRAM} -d symbols -n 50 -C full -s vm $ -- master_${FW_NAME} + DEPENDS px4 WORKING_DIRECTORY ${PX4_BINARY_DIR} VERBATIM USES_TERMINAL @@ -296,8 +285,8 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/gdbinit.in ${PX4_BINARY_DIR}/.gdbinit) add_custom_target(debug - COMMAND ${GDB} -iex 'set auto-load safe-path ${PX4_BINARY_DIR}' $ - DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit + COMMAND ${GDB} -iex 'set auto-load safe-path ${PX4_BINARY_DIR}' $ + DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL ) @@ -323,8 +312,8 @@ if(black_magic_probe_path) -ex 'attach 1' -ex 'load' -ex 'run' - $ - DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit + $ + DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL ) @@ -338,8 +327,8 @@ if(black_magic_probe_path) -ex 'attach 1' -ex 'load' -ex 'kill' - $ - DEPENDS ${FW_NAME} + $ + DEPENDS px4 WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL COMMENT "Uploading with Black Magic Probe" @@ -360,8 +349,8 @@ add_custom_target(jlink_upload -ex 'monitor reset' -ex 'load' -ex 'kill' - $ - DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit + $ + DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL ) @@ -375,8 +364,8 @@ add_custom_target(jlink_debug -ex 'load' -ex 'monitor reset' -ex 'continue' - $ - DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit + $ + DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit WORKING_DIRECTORY ${PX4_BINARY_DIR} USES_TERMINAL ) @@ -395,8 +384,8 @@ ExternalProject_Add(FlameGraph add_custom_target(profile COMMAND ${CMAKE_COMMAND} -E env PATH="${PX4_BINARY_DIR}/external/Source/FlameGraph:$ENV{PATH}" - ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh --elf=$ --nsamples=10000 - DEPENDS ${FW_NAME} ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh FlameGraph + ${CMAKE_CURRENT_SOURCE_DIR}/Debug/poor-mans-profiler.sh --elf=$ --nsamples=10000 + DEPENDS px4 ${CMAKE_CURRENT_SOURCE_DIR}/Debug/poor-mans-profiler.sh FlameGraph USES_TERMINAL WORKING_DIRECTORY ${PX4_BINARY_DIR} ) diff --git a/platforms/posix/CMakeLists.txt b/platforms/posix/CMakeLists.txt index b06cfb56d9..aa8a6f4df7 100644 --- a/platforms/posix/CMakeLists.txt +++ b/platforms/posix/CMakeLists.txt @@ -46,13 +46,6 @@ if (("${PX4_BOARD}" MATCHES "atlflight_eagle") OR ("${PX4_BOARD}" MATCHES "atlfl -Wl,--end-group ) - add_custom_target(upload - COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config /home/linaro - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL - ) - else() add_executable(px4 src/main.cpp @@ -100,33 +93,16 @@ px4_posix_generate_symlinks( TARGET px4 ) -if (("${PX4_BOARD}" MATCHES "raspberrypi") OR ("${PX4_BOARD}" MATCHES "navio2")) - add_custom_target(upload - COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"$ENV{AUTOPILOT_HOST}":/home/pi - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL - ) -elseif ("${PX4_BOARD}" MATCHES "beaglebone_blue") +# board defined upload helper +if(EXISTS "${PX4_BOARD_DIR}/cmake/upload.cmake") + include(${PX4_BOARD_DIR}/cmake/upload.cmake) +endif() + + +if ("${PX4_BOARD}" MATCHES "beaglebone_blue") target_link_libraries(px4 PRIVATE robotcontrol) - add_custom_target(upload - COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_SOURCE_DIR}/ROMFS debian@BBBluePX4:/home/debian/px4 - DEPENDS px4 - COMMENT "uploading px4 and data files" - USES_TERMINAL - ) - -elseif ("${PX4_BOARD}" MATCHES "bebop") - - add_custom_target(upload - COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. /data/ftp/internal_000 - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL - ) - elseif ("${PX4_BOARD}" MATCHES "sitl") include(sitl_target) diff --git a/platforms/qurt/CMakeLists.txt b/platforms/qurt/CMakeLists.txt index 512ee7518c..3c17462dd7 100644 --- a/platforms/qurt/CMakeLists.txt +++ b/platforms/qurt/CMakeLists.txt @@ -51,14 +51,4 @@ else() m ) - add_custom_target(upload - COMMAND - ${PX4_SOURCE_DIR}/Tools/adb_upload.sh - ${CMAKE_CURRENT_BINARY_DIR}/libpx4.so ${CMAKE_CURRENT_BINARY_DIR}/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config - /usr/share/data/adsp - DEPENDS px4 px4muorb_skel - COMMENT "uploading px4" - USES_TERMINAL - ) - endif()