forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace REDLINK upload method with LINKSERVER (#186)
* Replace REDLINK upload method with LINKSERVER * Fix sleep test failure on MIMXRT, fix failure to debug * Remove no longer needed XML files
- Loading branch information
1 parent
86723f7
commit 05a57dc
Showing
16 changed files
with
119 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
targets/upload_method_cfg/redlink_cfgs/MIMXRT1052xxxxB_part.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
targets/upload_method_cfg/redlink_cfgs/MIMXRT1062xxxxA_part.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2023 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# ---------------------------------------------- | ||
# CMake finder for LinkServer, the NXP command-line flash and debug tool | ||
# | ||
# This module defines: | ||
# LinkServer - Whether the reqested tools were found. | ||
# LinkServer_PATH - full path to the LinkServer command line tool. | ||
|
||
# Check for LinkServer install folders on Windows | ||
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") | ||
# On Windows, LinkServer by default is installed into a subdirectory of | ||
# C:/nxp | ||
file(GLOB LINKSERVER_HINTS LIST_DIRECTORIES TRUE "C:/nxp/LinkServer_*") | ||
elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") | ||
# On Mac, it was observed to install into /Applications/LinkServer_1.2.45/dist | ||
file(GLOB LINKSERVER_HINTS LIST_DIRECTORIES TRUE "/Applications/LinkServer_*/dist") | ||
else() | ||
set(LINKSERVER_HINTS /usr/local/LinkServer) # Linux package install location | ||
endif() | ||
|
||
find_program(LinkServer_PATH | ||
NAMES LinkServer | ||
DOC "Path to the LinkServer executable." | ||
HINTS ${LINKSERVER_HINTS} | ||
) | ||
|
||
find_package_handle_standard_args(LinkServer REQUIRED_VARS LinkServer_PATH) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2022 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
### NXP LinkServer Upload Method | ||
# This method needs the following parameters: | ||
# LINKSERVER_DEVICE - Chip name and board to connect to, separated by a colon. | ||
# LINKSERVER_PROBE_SN - Serial number, or serial number substring, of the debug probe to connect to. If blank, will connect to any probe. | ||
|
||
set(UPLOAD_SUPPORTS_DEBUG TRUE) | ||
|
||
### Handle options | ||
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.") | ||
|
||
if("${LINKSERVER_PROBE_SN}" STREQUAL "") | ||
# This argument causes Redlink to connect to the first available debug probe | ||
set(LINKSERVER_PROBE_ARGS "" CACHE INTERNAL "" FORCE) | ||
else() | ||
set(LINKSERVER_PROBE_ARGS --probe ${LINKSERVER_PROBE_SN} CACHE INTERNAL "" FORCE) | ||
endif() | ||
|
||
if("${LINKSERVER_DEVICE}" STREQUAL "") | ||
message(FATAL_ERROR "You must set LINKSERVER_DEVICE in your CMake scripts to use REDLINK") | ||
endif() | ||
|
||
### Check if upload method can be enabled on this machine | ||
find_package(LinkServer) | ||
set(UPLOAD_LINKSERVER_FOUND ${LinkServer_FOUND}) | ||
|
||
### Function to generate upload target | ||
|
||
function(gen_upload_target TARGET_NAME BIN_FILE HEX_FILE) | ||
|
||
add_custom_target(flash-${TARGET_NAME} | ||
COMMENT "Flashing ${TARGET_NAME} with LinkServer..." | ||
COMMAND ${LinkServer_PATH} | ||
flash | ||
${LINKSERVER_PROBE_ARGS} | ||
${LINKSERVER_DEVICE} | ||
load | ||
$<TARGET_FILE:${TARGET_NAME}>) | ||
|
||
add_dependencies(flash-${TARGET_NAME} ${TARGET_NAME}) | ||
|
||
endfunction(gen_upload_target) | ||
|
||
### Commands to run the debug server. | ||
set(UPLOAD_GDBSERVER_DEBUG_COMMAND | ||
${LinkServer_PATH} | ||
gdbserver | ||
${LINKSERVER_PROBE_ARGS} | ||
--gdb-port ${GDB_PORT} | ||
${LINKSERVER_DEVICE} | ||
) | ||
|
||
# request extended-remote GDB sessions | ||
set(UPLOAD_WANTS_EXTENDED_REMOTE TRUE) | ||
|
||
set(UPLOAD_LAUNCH_COMMANDS | ||
"monitor reset" # undocumented, but works | ||
"load" | ||
"break main" | ||
"monitor reset" | ||
) | ||
set(UPLOAD_RESTART_COMMANDS | ||
"monitor reset" | ||
) |
This file was deleted.
Oops, something went wrong.