diff --git a/CMakeLists.txt b/CMakeLists.txt index 063decbe..6e2ddeac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,9 @@ 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 USE_JLINK AND NOT USE_GDB_CLIENT) - set(USE_JLINK true) -endif() +#if(NOT USE_JLINK AND NOT USE_GDB_CLIENT) +# set(USE_JLINK true) +#endif() if(USE_JLINK) if (NOT NRFJPROG) @@ -44,6 +44,8 @@ elseif(USE_GDB_CLIENT) message(" * Programmer/debugger : GDB Client") message(" * GDB Client path : " ${GDB_CLIENT_BIN_PATH}) message(" * GDB Target : " ${GDB_CLIENT_TARGET_REMOTE}) +elseif(USE_OPENOCD_CLIENT) + message(" * Programmer/debugger : OpenOCD Client") endif() set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") diff --git a/cmake-nRF5x/CMake_nRF5x.cmake b/cmake-nRF5x/CMake_nRF5x.cmake index 0ecc60a3..4d0cb5da 100755 --- a/cmake-nRF5x/CMake_nRF5x.cmake +++ b/cmake-nRF5x/CMake_nRF5x.cmake @@ -401,6 +401,12 @@ macro(nRF5x_addExecutable EXECUTABLE_NAME SOURCE_FILES) COMMAND ${GDB_CLIENT_BIN_PATH} -nx --batch -ex 'target extended-remote ${GDB_CLIENT_TARGET_REMOTE}' -ex 'monitor swdp_scan' -ex 'attach 1' -ex 'load' -ex 'kill' ${EXECUTABLE_NAME}-full.hex COMMENT "flashing ${EXECUTABLE_NAME}-full.hex" ) + elseif(USE_OPENOCD_CLIENT) + add_custom_target("FLASH_MERGED_${EXECUTABLE_NAME}" + DEPENDS ${EXECUTABLE_NAME} + COMMAND /usr/bin/openocd -c "tcl_port disabled" -c "gdb_port 3333" -c "telnet_port 4444" -f /home/luben/code/Pinetime/pinetime.cfg -c "program \"${EXECUTABLE_NAME}-full.hex\"" -c reset -c shutdown + COMMENT "flashing ${EXECUTABLE_NAME}-full.hex" + ) endif() endif() diff --git a/pinetime.cfg b/pinetime.cfg new file mode 100644 index 00000000..23b5ffce --- /dev/null +++ b/pinetime.cfg @@ -0,0 +1,7 @@ + +source [find interface/stlink.cfg] + +transport select hla_swd +#set WORKAREASIZE 0 + +source [find target/nrf52.cfg]