diff --git a/tools/cmake/upload_methods/UploadMethodOPENOCD.cmake b/tools/cmake/upload_methods/UploadMethodOPENOCD.cmake index 6286d40a29f..25b154567c8 100644 --- a/tools/cmake/upload_methods/UploadMethodOPENOCD.cmake +++ b/tools/cmake/upload_methods/UploadMethodOPENOCD.cmake @@ -48,7 +48,7 @@ function(gen_upload_target TARGET_NAME BIN_FILE) ${OPENOCD_CHIP_CONFIG_COMMANDS} ${OPENOCD_ADAPTER_SERIAL_COMMAND} -c "gdb_port disabled" # Don't start a GDB server when just programming - -c "program $ reset exit" + -c "program $,${CMAKE_CURRENT_BINARY_DIR}/$.${MBED_OUTPUT_EXT},$> reset exit" VERBATIM) add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})