Skip to content

Commit c064da8

Browse files
committed
fix upload JLink
1 parent d0de758 commit c064da8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tools/cmake/upload_methods/UploadMethodJLINK.cmake

+9-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ endif()
3939

4040
option(JLINK_NO_GUI "If true, suppress GUI dialog boxes from the J-Link software. Note: does not suppress license dialogs from J-Link EDU and On-Board probes, these are intentionally impossible to disable." FALSE)
4141
if(JLINK_NO_GUI)
42-
set(JLINK_NOGUI_ARG -Nogui CACHE INTERNAL "" FORCE)
42+
set(JLINK_NOGUI_ARG "-NoGui 1" CACHE INTERNAL "" FORCE)
4343
else()
4444
set(JLINK_NOGUI_ARG "" CACHE INTERNAL "" FORCE)
4545
endif()
@@ -53,7 +53,11 @@ function(gen_upload_target TARGET_NAME BINARY_FILE)
5353
# Note: loadfile currently only honors the base address for .bin files. For hex files it uses the offset read
5454
# from the hex file. Unsure if that will be an issue or not...
5555
file(GENERATE OUTPUT ${COMMAND_FILE_PATH} CONTENT
56-
"loadfile ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR}
56+
"
57+
JTAGConf -1,-1
58+
ExitOnError 1
59+
connect
60+
loadfile ${BINARY_FILE} ${MBED_UPLOAD_BASE_ADDR}
5761
r
5862
go
5963
exit
@@ -62,13 +66,11 @@ exit
6266
COMMENT "Flashing ${TARGET_NAME} with J-Link..."
6367
COMMAND ${JLINK}
6468
${JLINK_SELECT_ARG}
65-
${JLINK_NOGUI_ARG}
6669
-Device \"${JLINK_CPU_NAME}\"
6770
-Speed ${JLINK_CLOCK_SPEED}
6871
-if ${JLINK_UPLOAD_INTERFACE}
69-
-JTAGConf -1,-1
70-
-AutoConnect 1
71-
-ExitOnError
72+
-AutoConnect 1
73+
-NoGui 1
7274
-CommandFile ${COMMAND_FILE_PATH})
7375

7476
endfunction(gen_upload_target)
@@ -102,4 +104,4 @@ set(UPLOAD_LAUNCH_COMMANDS
102104
set(UPLOAD_RESTART_COMMANDS
103105
"monitor halt"
104106
"monitor reset"
105-
)
107+
)

0 commit comments

Comments
 (0)