From 81d629e86a888d41cd17c89a8c9c2dd6d596fb4e Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 17 Jan 2020 14:56:56 +0100 Subject: Add support for Black magic probe (using GDB client). Add documentation about that in README.md --- CMakeLists.txt | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') 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=") endif () -if (NOT NRFJPROG) - message(FATAL_ERROR "the path to the tool nrfjprog must be specified on the command line (add -DNRFJPROG=") -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=") + 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=") + 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) -- cgit v1.2.3-70-g09d2