Skip to content

Commit 11369b4

Browse files
Add standard upload method variables (#369)
* Start on fixing some unintentionally skipped tests * Add standard upload method variables * pyocd works now!! * Revert "Start on fixing some unintentionally skipped tests" * Don't require memory banks if not using an upload method * Oops remove duplicate serial number
1 parent 3cb82bf commit 11369b4

9 files changed

+82
-60
lines changed

targets/upload_method_cfg/K64F.cmake

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
# include app.cmake and where you add mbed os as a subdirectory.
44
#
55
# Notes:
6-
# 1. PyOCD did not actually work in my testing as of Apr 2024, though this device is supposed to be supported
7-
# 2. Be sure to update the DAPLink firmware on the board via these instructions: https://os.mbed.com/blog/entry/DAPLink-bootloader-update/
8-
# 3. OpenOCD 0.12 flashes this device perfectly and can enter a debug session, but cannot hit breakpoints
9-
# 4. LinkServer can both flash and debug, so it's the recommended upload method for this device.
10-
# 5. LinkServer does appear to have a bug where it doesn't map the peripheral registers as valid memory, so you can't
6+
# 1. Be sure to update the DAPLink firmware on the board via these instructions: https://os.mbed.com/blog/entry/DAPLink-bootloader-update/
7+
# 2. OpenOCD 0.12 flashes this device perfectly and can enter a debug session, but cannot hit breakpoints
8+
# 3. LinkServer can both flash and debug, so it's the recommended upload method for this device.
9+
# 4. LinkServer does appear to have a bug where it doesn't map the peripheral registers as valid memory, so you can't
1110
# inspect them. I was able to work around this by inserting a block like this into <LinkServer install dir>/devices/FRDM-K64F.json:
1211
#
1312
# "name": "MK64FN1M0xxx12",

tools/cmake/UploadMethodManager.cmake

+50-13
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,71 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# ----------------------------------------------
5-
# Load the upload method that the user selects
5+
# Common upload method options
66

77
# This variable should have been set in app.cmake or by the upload method cfg file, sanity check here
88
if(NOT DEFINED UPLOAD_METHOD_DEFAULT)
99
message(FATAL_ERROR "UPLOAD_METHOD_DEFAULT not found.")
1010
endif()
1111

12+
## Upload method
1213
set(UPLOAD_METHOD "${UPLOAD_METHOD_DEFAULT}" CACHE STRING "Method for uploading programs to the mbed")
1314

14-
# use a higher numbered port to allow use without root on Linux/Mac
15-
set(GDB_PORT 23331 CACHE STRING "Port that the GDB server will be started on.")
16-
17-
# Upload methods must be uppercase, guard against the user making a mistake (since Windows will allow opening
18-
# an include file with the wrong case, the error message gets confusing)
15+
# Upload methods must be uppercase, guard against the user making a mistake (since Windows and Mac will allow including
16+
# an include file with the wrong case, the error that happens later gets confusing)
1917
string(TOUPPER "${UPLOAD_METHOD}" UPLOAD_METHOD_UCASE)
2018
if(NOT "${UPLOAD_METHOD_UCASE}" STREQUAL "${UPLOAD_METHOD}")
2119
message(WARNING "UPLOAD_METHOD value should be uppercase. It has been automatically changed to \"${UPLOAD_METHOD_UCASE}\".")
2220
set(UPLOAD_METHOD "${UPLOAD_METHOD_UCASE}" CACHE STRING "" FORCE)
2321
endif()
2422

25-
# Load the upload method. This is expected to set the following variables:
26-
# UPLOAD_${UPLOAD_METHOD}_FOUND - True iff the dependencies for this upload method were found
27-
# UPLOAD_SUPPORTS_DEBUG - True iff this upload method supports debugging
28-
# UPLOAD_GDBSERVER_DEBUG_COMMAND - Command to start a new GDB server
29-
# UPLOAD_WANTS_EXTENDED_REMOTE - True iff GDB should use "target extended-remote" to connect to the GDB server
30-
# UPLOAD_LAUNCH_COMMANDS - List of GDB commands to run after launching GDB.
31-
# UPLOAD_RESTART_COMMANDS - List of GDB commands to run when the "restart chip" function is used.
23+
## GDB port
24+
# use a higher numbered port to allow use without root on Linux/Mac
25+
set(MBED_GDB_PORT 23331 CACHE STRING "Port that the GDB server will be started on.")
26+
27+
## Upload tool serial number
28+
set(MBED_UPLOAD_SERIAL_NUMBER "" CACHE STRING "Serial number of the Mbed board or the programming tool, for upload methods that select by serial number.")
29+
30+
# Handle legacy per-upload-method aliases for the upload serial number
31+
foreach(LEGACY_VAR_NAME JLINK_USB_SERIAL_NUMBER LINKSERVER_PROBE_SN MBED_TARGET_UID OPENOCD_ADAPTER_SERIAL PYOCD_PROBE_UID STLINK_SERIAL_ARGUMENT STM32CUBE_PROBE_SN)
32+
if(DEFINED ${LEGACY_VAR_NAME})
33+
if(NOT "${${LEGACY_VAR_NAME}}" STREQUAL "")
34+
message(WARNING "${LEGACY_VAR_NAME} is deprecated, set the MBED_UPLOAD_SERIAL_NUMBER variable instead. MBED_UPLOAD_SERIAL_NUMBER will be set to the value of ${LEGACY_VAR_NAME}.")
35+
set(MBED_UPLOAD_SERIAL_NUMBER ${${LEGACY_VAR_NAME}} CACHE STRING "" FORCE)
36+
endif()
37+
endif()
38+
endforeach()
39+
40+
## Upload base address
41+
if(NOT DEFINED MBED_UPLOAD_BASE_ADDR OR "${MBED_UPLOAD_BASE_ADDR}" STREQUAL "")
42+
set(BASE_ADDR_DESCRIPTION "Base address for uploading code, i.e. the memory address where the first byte of the bin/hex file will get loaded to (with 0x prefix). Generally should point to the start of the desired flash bank and defaults to the configured start of the primary ROM bank (MBED_CONFIGURED_ROM_START).")
43+
if(MBED_CONFIG_DEFINITIONS MATCHES "MBED_CONFIGURED_ROM_START=(0x[0-9a-zA-Z]+)")
44+
set(MBED_UPLOAD_BASE_ADDR ${CMAKE_MATCH_1} CACHE STRING ${BASE_ADDR_DESCRIPTION})
45+
else()
46+
if(NOT ${UPLOAD_METHOD} STREQUAL "NONE")
47+
message(FATAL_ERROR "Since no ROM banks have been defined, you need to set the MBED_UPLOAD_BASE_ADDR option so we know where to upload code. NOTE: If you upgraded from an old version of Mbed CE and are getting this error, delete and reconfigure your CMake build directory.")
48+
endif()
49+
endif()
50+
endif()
51+
52+
# ----------------------------------------------
53+
# Load the upload method.
54+
# Upload methods are expected to refer to the following variables:
55+
# - MBED_UPLOAD_SERIAL_NUMBER - USB serial number of the mbed board or of the programmer
56+
# - MBED_UPLOAD_BASE_ADDR - Base address of the flash where the bin file will be updated
57+
#
58+
# Upload methods are expected to set the following variables:
59+
# - UPLOAD_${UPLOAD_METHOD}_FOUND - True iff the dependencies for this upload method were found
60+
# - UPLOAD_SUPPORTS_DEBUG - True iff this upload method supports debugging
61+
# - UPLOAD_GDBSERVER_DEBUG_COMMAND - Command to start a new GDB server
62+
# - UPLOAD_WANTS_EXTENDED_REMOTE - True iff GDB should use "target extended-remote" to connect to the GDB server
63+
# - UPLOAD_LAUNCH_COMMANDS - List of GDB commands to run after launching GDB.
64+
# - UPLOAD_RESTART_COMMANDS - List of GDB commands to run when the "restart chip" function is used.
3265
# See here for more info: https://github.com/mbed-ce/mbed-os/wiki/Debugger-Commands-and-State-in-Upload-Methods
66+
#
67+
# WARNING: Upload method files are included during the add_subdirectory(mbed-os) call in the top-level CMakeLists.txt. This means that
68+
# if you declare variables in an upload method script, you have to save them as CACHE INTERNAL (or PARENT_SCOPE) so that they are accessible
69+
# to code running outside of the mbed-os subdirectory.
3370
include(UploadMethod${UPLOAD_METHOD})
3471

3572
if(NOT "${UPLOAD_${UPLOAD_METHOD}_FOUND}")

tools/cmake/upload_methods/UploadMethodJLINK.cmake

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# JLINK_CLOCK_SPEED - Speed to run the J-Link at, in KHz.
88
# JLINK_CPU_NAME - Name of CPU to pass to J-Link
99
# This method has the following options:
10-
# JLINK_USB_SERIAL_NUMBER - Use a J-Link connected over USB with the specified serial number.
1110
# JLINK_NETWORK_ADDRESS - Use a J-Link connected over the network with the given <ip addr>[:port]
1211
# JLINK_NO_GUI - If set to true, suppress GUI dialog boxes from the J-Link software.
1312
#
@@ -19,14 +18,13 @@ find_package(JLINK)
1918
set(UPLOAD_JLINK_FOUND ${JLINK_FOUND})
2019

2120
### Setup options
22-
set(JLINK_USB_SERIAL_NUMBER "" CACHE STRING "Use a J-Link connected over USB with the specified serial number.")
2321
set(JLINK_NETWORK_ADDRESS "" CACHE STRING "Use a J-Link connected over the network with the given <ip addr>[:port]")
2422

2523
# Figure out -select option. See here: https://wiki.segger.com/J-Link_GDB_Server#-select
26-
if((NOT "${JLINK_USB_SERIAL_NUMBER}" STREQUAL "") AND (NOT "${JLINK_NETWORK_ADDRESS}" STREQUAL ""))
27-
message(FATAL_ERROR "Cannot use both JLINK_USB_SERIAL_NUMBER and JLINK_NETWORK_ADDRESS at the same time!")
28-
elseif(NOT "${JLINK_USB_SERIAL_NUMBER}" STREQUAL "")
29-
set(JLINK_SELECT_ARG -Select usb=${JLINK_USB_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
24+
if((NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "") AND (NOT "${JLINK_NETWORK_ADDRESS}" STREQUAL ""))
25+
message(FATAL_ERROR "Cannot use both MBED_UPLOAD_SERIAL_NUMBER and JLINK_NETWORK_ADDRESS at the same time!")
26+
elseif(NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
27+
set(JLINK_SELECT_ARG -Select usb=${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
3028
elseif(NOT "${JLINK_NETWORK_ADDRESS}" STREQUAL "")
3129
set(JLINK_SELECT_ARG -Select ip=${JLINK_NETWORK_ADDRESS} CACHE INTERNAL "" FORCE)
3230
else()
@@ -51,8 +49,11 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
5149

5250
# create command file for j-link
5351
set(COMMAND_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/flash-${TARGET_NAME}.jlink)
52+
53+
# Note: loadfile currently only honors the base address for .bin files. For hex files it uses the offset read
54+
# from the hex file. Unsure if that will be an issue or not...
5455
file(GENERATE OUTPUT ${COMMAND_FILE_PATH} CONTENT
55-
"loadfile ${BINARY_FILE}
56+
"loadfile ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR}
5657
r
5758
go
5859
exit

tools/cmake/upload_methods/UploadMethodLINKSERVER.cmake

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
### NXP LinkServer Upload Method
55
# This method needs the following parameters:
66
# LINKSERVER_DEVICE - Chip name and board to connect to, separated by a colon.
7-
# LINKSERVER_PROBE_SN - Serial number, or serial number substring, of the debug probe to connect to. If blank, will connect to any probe.
87

98
set(UPLOAD_SUPPORTS_DEBUG TRUE)
109

1110
### Handle options
12-
set(LINKSERVER_PROBE_SN "" CACHE STRING "Serial number, or serial number substring, of the debug probe to connect to. If blank, will connect to any probe.")
13-
14-
if("${LINKSERVER_PROBE_SN}" STREQUAL "")
11+
if("${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
1512
# This argument causes Redlink to connect to the first available debug probe
1613
set(LINKSERVER_PROBE_ARGS "" CACHE INTERNAL "" FORCE)
1714
else()
18-
set(LINKSERVER_PROBE_ARGS --probe ${LINKSERVER_PROBE_SN} CACHE INTERNAL "" FORCE)
15+
set(LINKSERVER_PROBE_ARGS --probe ${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
1916
endif()
2017

2118
if("${LINKSERVER_DEVICE}" STREQUAL "")
@@ -37,7 +34,8 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
3734
${LINKSERVER_PROBE_ARGS}
3835
${LINKSERVER_DEVICE}
3936
load
40-
$<TARGET_FILE:${TARGET_NAME}>)
37+
--addr ${MBED_UPLOAD_BASE_ADDR}
38+
${BINARY_FILE})
4139

4240
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})
4341

tools/cmake/upload_methods/UploadMethodMBED.cmake

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# This method needs the following parameters:
33
# MBED_RESET_BAUDRATE - Serial baudrate to connect to the target at when resetting it.
44
# This method creates the following options:
5-
# MBED_TARGET_UID - Probe UID to pass to commands. You can get the UIDs from `python -m pyocd list`.
65

76
set(UPLOAD_SUPPORTS_DEBUG FALSE)
87

@@ -13,8 +12,6 @@ if(NOT DEFINED MBED_RESET_BAUDRATE)
1312
set(MBED_RESET_BAUDRATE 9600)
1413
endif()
1514

16-
set(MBED_TARGET_UID "" CACHE STRING "UID of mbed target to upload to if there are multiple connected. You can get the UIDs from `python -m pyocd list`")
17-
1815
### Function to generate upload target
1916
function(gen_upload_target TARGET_NAME BINARY_FILE)
2017

@@ -23,7 +20,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
2320
${BINARY_FILE}
2421
${MBED_TARGET}
2522
${MBED_RESET_BAUDRATE}
26-
${MBED_TARGET_UID}
23+
${MBED_UPLOAD_SERIAL_NUMBER}
2724
WORKING_DIRECTORY
2825
${mbed-os_SOURCE_DIR}/tools/python
2926
VERBATIM)

tools/cmake/upload_methods/UploadMethodOPENOCD.cmake

+5-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
### OpenOCD Upload Method
55
# This method needs the following parameters:
66
# OPENOCD_CHIP_CONFIG_COMMANDS - Specifies all OpenOCD commands needed to configure openocd for your target processor.
7+
# OPENOCD_LOAD_ADDRESS - Address where the bin or hex file will be loaded to memory, e.g. 0x8000000. If not set, will default to
8+
# the configured address of the first ROM bank (MBED_CONFIGURED_ROM_START)
79
# This method creates the following options:
8-
# OPENOCD_ADAPTER_SERIAL - Serial number of the debug adapter to select for OpenOCD. Set to empty to detect any matching adapter.
910
# OPENOCD_VERSION_RANGE - Acceptable version range of OpenOCD. This may be a single version, in which case it is treated as
1011
# a minimum, or a versionMin...<versionMax constraint, e.g. 0.12...<0.13, to accept any 0.12.x version but not 0.13 or higher.
1112

@@ -15,12 +16,9 @@ set(UPLOAD_SUPPORTS_DEBUG TRUE)
1516
find_package(OpenOCD ${OPENOCD_VERSION_RANGE})
1617
set(UPLOAD_OPENOCD_FOUND ${OpenOCD_FOUND})
1718

18-
### Setup options
19-
set(OPENOCD_ADAPTER_SERIAL "" CACHE STRING "Serial number of the debug adapter to select for OpenOCD. Set to empty to detect any matching adapter.")
20-
2119
### Function to generate upload target
2220
set(OPENOCD_ADAPTER_SERIAL_COMMAND "" CACHE INTERNAL "" FORCE)
23-
if(NOT "${OPENOCD_ADAPTER_SERIAL}" STREQUAL "")
21+
if(NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
2422

2523
# Generate script file that tells OpenOCD how to find the correct debug adapter.
2624
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/openocd_adapter_config.cfg CONTENT
@@ -29,7 +27,7 @@ if(NOT "${OPENOCD_ADAPTER_SERIAL}" STREQUAL "")
2927
3028
# There's supposed to be a standard command to select the adapter serial ('adapter serial'), but it seems
3129
# like not all adapters support this yet so extra work is needed.
32-
set adapter_serial \"${OPENOCD_ADAPTER_SERIAL}\"
30+
set adapter_serial \"${MBED_UPLOAD_SERIAL_NUMBER}\"
3331
if { [adapter name] == \"hla\" } {
3432
hla_serial $adapter_serial
3533
} elseif { [adapter name] == \"cmsis-dap\" } {
@@ -50,7 +48,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
5048
${OPENOCD_CHIP_CONFIG_COMMANDS}
5149
${OPENOCD_ADAPTER_SERIAL_COMMAND}
5250
-c "gdb_port disabled" # Don't start a GDB server when just programming
53-
-c "program ${BINARY_FILE} reset exit"
51+
-c "program ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR} reset exit"
5452
VERBATIM)
5553

5654
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})

tools/cmake/upload_methods/UploadMethodPYOCD.cmake

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# This method needs the following parameters:
66
# PYOCD_TARGET_NAME - Name of your processor as passed to the -t option of pyOCD. This is usually the full or partial model number.
77
# PYOCD_CLOCK_SPEED - Clock speed of the JTAG or SWD connection. Default is in Hz, but can use k and M suffixes for MHz and GHz
8-
# This method creates the following options:
9-
# PYOCD_PROBE_UID - Probe UID to pass to pyOCD commands. You can get the UIDs from `python -m pyocd list`. Set to empty to detect any probe.
108

119
set(UPLOAD_SUPPORTS_DEBUG TRUE)
1210

@@ -15,13 +13,10 @@ include(CheckPythonPackage)
1513
check_python_package(pyocd HAVE_PYOCD)
1614
set(UPLOAD_PYOCD_FOUND ${HAVE_PYOCD})
1715

18-
### Setup options
19-
set(PYOCD_PROBE_UID "" CACHE STRING "Probe UID to pass to pyOCD commands. You can get the UIDs from `python -m pyocd list`. Set to empty to detect any probe.")
20-
2116
### Function to generate upload target
2217
set(PYOCD_PROBE_ARGS "" CACHE INTERNAL "" FORCE)
23-
if(NOT "${PYOCD_PROBE_UID}" STREQUAL "")
24-
set(PYOCD_PROBE_ARGS --probe ${PYOCD_PROBE_UID} CACHE INTERNAL "" FORCE)
18+
if(NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
19+
set(PYOCD_PROBE_ARGS --probe ${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
2520
endif()
2621

2722
function(gen_upload_target TARGET_NAME BINARY_FILE)
@@ -36,6 +31,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
3631
-f ${PYOCD_CLOCK_SPEED}
3732
-t ${PYOCD_TARGET_NAME}
3833
${PYOCD_PROBE_ARGS}
34+
--base-address ${MBED_UPLOAD_BASE_ADDR}
3935
${BINARY_FILE})
4036

4137
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})

tools/cmake/upload_methods/UploadMethodSTLINK.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if(stlink_FOUND AND (stlink_VERSION VERSION_LESS 1.7.0))
1515
endif()
1616

1717
### Figure out --serial argument
18-
if(DEFINED STLINK_PROBE_SN AND NOT "${STLINK_PROBE_SN}" STREQUAL "")
19-
set(STLINK_SERIAL_ARGUMENT --serial ${STLINK_PROBE_SN} CACHE INTERNAL "" FORCE)
18+
if(DEFINED MBED_UPLOAD_SERIAL_NUMBER AND NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
19+
set(STLINK_SERIAL_ARGUMENT --serial ${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
2020
else()
2121
set(STLINK_SERIAL_ARGUMENT "" CACHE INTERNAL "" FORCE)
2222
endif()
@@ -30,7 +30,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
3030
--reset # Reset chip after flashing
3131
${STLINK_SERIAL_ARGUMENT}
3232
${STLINK_ARGS}
33-
write ${BINARY_FILE} ${STLINK_LOAD_ADDRESS})
33+
write ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR})
3434

3535
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})
3636
endfunction(gen_upload_target)

tools/cmake/upload_methods/UploadMethodSTM32CUBE.cmake

+4-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
# This method needs the following parameters:
66
# STM32CUBE_CONNECT_COMMAND - "Connect" (-c) command to pass to the programmer
77
# STM32CUBE_GDBSERVER_ARGS - Arguments to pass to the ST-Link gdbserver.
8-
# This method creates the following options:
9-
# STM32CUBE_PROBE_SN - Serial number of the ST-Link probe to connect to. If blank, will connect to any probe.
10-
11-
set(STM32CUBE_PROBE_SN "" CACHE STRING "Serial number of the ST-Link probe to connect to. If blank, will connect to any probe.")
128

139
### Check if upload method can be enabled on this machine
1410
find_package(STLINKTools COMPONENTS STM32CubeProg OPTIONAL_COMPONENTS STLINK_gdbserver)
@@ -25,9 +21,9 @@ endif()
2521
set(STM32CUBE_UPLOAD_PROBE_ARGS "" CACHE INTERNAL "" FORCE)
2622
set(STM32CUBE_GDB_PROBE_ARGS "" CACHE INTERNAL "" FORCE)
2723

28-
if(NOT "${STM32CUBE_PROBE_SN}" STREQUAL "")
29-
set(STM32CUBE_UPLOAD_PROBE_ARGS sn=${STM32CUBE_PROBE_SN} CACHE INTERNAL "" FORCE)
30-
set(STM32CUBE_GDB_PROBE_ARGS --serial-number ${STM32CUBE_PROBE_SN} CACHE INTERNAL "" FORCE)
24+
if(NOT "${MBED_UPLOAD_SERIAL_NUMBER}" STREQUAL "")
25+
set(STM32CUBE_UPLOAD_PROBE_ARGS sn=${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
26+
set(STM32CUBE_GDB_PROBE_ARGS --serial-number ${MBED_UPLOAD_SERIAL_NUMBER} CACHE INTERNAL "" FORCE)
3127
endif()
3228

3329
function(gen_upload_target TARGET_NAME BINARY_FILE)
@@ -37,7 +33,7 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
3733
COMMAND ${STM32CubeProg_COMMAND}
3834
${STM32CUBE_CONNECT_COMMAND}
3935
${STM32CUBE_UPLOAD_PROBE_ARGS} # probe arg must be immediately after -c command as it gets appended to -c
40-
-w "$<TARGET_FILE:${TARGET_NAME}>"
36+
-w ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR}
4137
-rst)
4238

4339
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME})

0 commit comments

Comments
 (0)