summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-01-17 14:56:56 +0100
committerJF <jf@codingfield.com>2020-01-17 14:56:56 +0100
commit81d629e86a888d41cd17c89a8c9c2dd6d596fb4e (patch)
treef544337706e3c5b4d4a48eb666b766eb835d803d /CMakeLists.txt
parent6abf12ffb7a26e8d42b1dcb41b1fa9bcccd3ac16 (diff)
Add support for Black magic probe (using GDB client).
Add documentation about that in README.md
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 34 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b615ca8..4dc64ca4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,9 +11,40 @@ if (NOT NRF5_SDK_PATH)
message(FATAL_ERROR "The path to the NRF52 SDK must be specified on the command line (add -DNRF5_SDK_PATH=<path>")
endif ()
-if (NOT NRFJPROG)
- message(FATAL_ERROR "the path to the tool nrfjprog must be specified on the command line (add -DNRFJPROG=<path>")
-endif ()
+if(NOT USE_JLINK AND NOT USE_GDB_CLIENT)
+ set(USE_JLINK true)
+endif()
+
+if(USE_JLINK)
+ if (NOT NRFJPROG)
+ message(FATAL_ERROR "the path to the tool nrfjprog must be specified on the command line (add -DNRFJPROG=<path>")
+ endif ()
+endif()
+
+if(USE_GDB_CLIENT)
+ if(NOT GDB_CLIENT_BIN_PATH)
+ set(GDB_CLIENT_BIN_PATH "arm-none-eabi-gdb")
+ endif()
+
+ if(NOT GDB_CLIENT_TARGET_REMOTE)
+ message(FATAL_ERROR "The GDB target must be specified (add -DGDB_CLIENT_TARGET_REMOTE=<target>")
+ endif()
+endif()
+
+message("BUILD CONFIGURATION")
+message("-------------------")
+message(" * Toolchain : " ${ARM_NONE_EABI_TOOLCHAIN_PATH})
+message(" * NRF52 SDK : " ${NRF5_SDK_PATH})
+set(PROGRAMMER "???")
+if(USE_JLINK)
+ message(" * Programmer/debugger : JLINK")
+ message(" * NrfJprog : " ${NRFJPROG})
+elseif(USE_GDB_CLIENT)
+ message(" * Programmer/debugger : GDB Client")
+ message(" * GDB Client path : " ${GDB_CLIENT_BIN_PATH})
+ message(" * GDB Target : " ${GDB_CLIENT_TARGET_REMOTE})
+endif()
+
include("cmake-nRF5x/CMake_nRF5x.cmake")
add_subdirectory(src)