diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index a0cec1f31e..7be7602183 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -555,7 +555,8 @@ class uploader(object): "high that it is not safe! If unsure, use px4fmu-v2_default.\n" "\n" "If you know you that the board does not have the silicon errata, use\n" - "this script with --force, or update the bootloader.\n") + "this script with --force, or update the bootloader. If you are invoking\n" + "upload using make, you can use force-upload target to force the upload.\n") self.__erase("Erase ") self.__program("Program", fw) diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index e7bfe9ba5e..0333597703 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -189,6 +189,14 @@ if (TARGET parameters_xml AND TARGET airframes_xml) 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 + ) endif() endif()